Skip to content

Commit 2ab66a4

Browse files
Merge pull request #45 from DigitalProductInnovationAndDevelopment/feat/add-faqs
add faqs
2 parents afffc43 + 7e5ab7a commit 2ab66a4

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# CVE Search plugin data
1313

1414
.cve_search_data/
15-
15+
.docs
16+
.idea
1617
.DS_Store
1718

1819
.env.docker

FAQ.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Frequently Asked Questions
2+
3+
A compiled list of FAQs that may come in handy.
4+
5+
## Import ot found?
6+
7+
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.
8+
9+
If you have something in `src/lib` and want to use it, import it as follows:
10+
11+
```python
12+
import lib # or
13+
from lib import ...
14+
```
15+
16+
# Why are env.docker and .env different?
17+
18+
If you are only running the program using Docker, then you only need to worry about `.env.docker`.
19+
20+
As the addresses tend to be different in a Docker environment compared to a local environment, you need different values to resolve the addresses.
21+
22+
For example, if you have your program outside Docker (locally) and want to access a database, you may use:
23+
24+
```
25+
POSTGRES_SERVER=localhost
26+
```
27+
28+
If you run your program inside Docker, then you must use:
29+
30+
```
31+
POSTGRES_SERVER=db
32+
```
33+
34+
# How can i add my own LLM Strategy?
35+
36+
There is a `BaseLLMService` that you can extend to create your own strategy. You can then use it as follows:
37+
38+
```python
39+
class CustomService(BaseLLMService, LLMServiceMixin):
40+
#your methods
41+
42+
my_strategy = CustomService() # instead of my_strategy = OLLAMAService()
43+
llm_service = LLMServiceStrategy(my_strategy)
44+
45+
```
46+
47+
# What if my input data changes ?
48+
49+
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.
50+
51+
Inside the db model called `Findings`, there is a method `from_data` which can be modified to adapt the changes.

src/.env.example

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OLLAMA_URL=http://localhost:11434
2+
OLLAMA_MODEL=phi3:mini
3+
# Postgres
4+
POSTGRES_SERVER=localhost
5+
POSTGRES_PORT=5432
6+
POSTGRES_DB=app
7+
POSTGRES_USER=postgres
8+
POSTGRES_PASSWORD=postgres
9+
10+
11+
AI_STRATEGY=OLLAMA #OLLAMA,OPENAI,ANTHROPIC
12+
13+
; ANTHROPIC_API_KEY=
14+
; OPENAI_API_KEY=
15+
16+
QUEUE_PROCESSING_LIMIT=10
17+
18+
REDIS_ENDPOINT= redis://localhost:6379/0
19+
20+
DB_DEBUG=false #Prints all SQL queries. 'true' or 'false'
21+
22+
23+
ENVIRONMENT=development

0 commit comments

Comments
 (0)