Skip to content

Commit

Permalink
Merge pull request #45 from DigitalProductInnovationAndDevelopment/fe…
Browse files Browse the repository at this point in the history
…at/add-faqs

add faqs
  • Loading branch information
ishworgiri1999 authored Jul 17, 2024
2 parents afffc43 + 7e5ab7a commit 2ab66a4
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
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

0 comments on commit 2ab66a4

Please sign in to comment.