diff --git a/.gitignore b/.gitignore index 1f99741..381e1fa 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,8 @@ # CVE Search plugin data .cve_search_data/ - +.docs +.idea .DS_Store .env.docker diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..bb95d18 --- /dev/null +++ b/FAQ.md @@ -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. diff --git a/src/.env.example b/src/.env.example new file mode 100644 index 0000000..4232a43 --- /dev/null +++ b/src/.env.example @@ -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 \ No newline at end of file