Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faqs #45

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# CVE Search plugin data

.cve_search_data/

.docs
.idea
.DS_Store

.env.docker
Expand Down
51 changes: 51 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Frequently Asked Questions

A compiled list of FAQs that may come in handy.

## Import ot found?

If you are getting an "import not found" error, it is likely because the base folder is always `src`. Always run the program from the `src` folder or use the commands inside the Makefile.

If you have something in `src/lib` and want to use it, import it as follows:

```python
import lib # or
from lib import ...
```

# Why are env.docker and .env different?

If you are only running the program using Docker, then you only need to worry about `.env.docker`.

As the addresses tend to be different in a Docker environment compared to a local environment, you need different values to resolve the addresses.

For example, if you have your program outside Docker (locally) and want to access a database, you may use:

```
POSTGRES_SERVER=localhost
```

If you run your program inside Docker, then you must use:

```
POSTGRES_SERVER=db
```

# How can i add my own LLM Strategy?

There is a `BaseLLMService` that you can extend to create your own strategy. You can then use it as follows:

```python
class CustomService(BaseLLMService, LLMServiceMixin):
#your methods

my_strategy = CustomService() # instead of my_strategy = OLLAMAService()
llm_service = LLMServiceStrategy(my_strategy)

```

# What if my input data changes ?

We have a predefined structure that input must adhere to called `Content`. You can always adjust this to satisfy your input and convert it to a database model.

Inside the db model called `Findings`, there is a method `from_data` which can be modified to adapt the changes.
23 changes: 23 additions & 0 deletions src/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=phi3:mini
# Postgres
POSTGRES_SERVER=localhost
POSTGRES_PORT=5432
POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres


AI_STRATEGY=OLLAMA #OLLAMA,OPENAI,ANTHROPIC

; ANTHROPIC_API_KEY=
; OPENAI_API_KEY=

QUEUE_PROCESSING_LIMIT=10

REDIS_ENDPOINT= redis://localhost:6379/0

DB_DEBUG=false #Prints all SQL queries. 'true' or 'false'


ENVIRONMENT=development
Loading