Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/BibleNLP/assitant.bible
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
woodwardmw committed Feb 22, 2024
2 parents 0bd47b6 + 2f4e7b1 commit fd8664a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/core/llm_framework/openai_vanilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_context(source_documents):
# ** This will need to be adjusted, based on what the returned results look like **
for _, source_document in enumerate(source_documents):
if (
len(source_document.page_content) + len(context) > 11000
len(source_document.page_content) + len(context) > 44000
): # FIXME: use tiktoken library to count tokens
break
if source_document.metadata.get("source", "") is not None:
Expand All @@ -36,7 +36,8 @@ def get_pre_prompt(context):
"""Constructs a pre-prompt for the conversation, including the context"""
chat_prefix = "The following is a conversation with an AI assistant for "
chat_prefix += "Bible translators. The assistant is"
chat_prefix += " helpful, creative, clever, very friendly and follows instructions carefully.\n"
chat_prefix += "verbose, helpful, creative, clever, very friendly and follows instructions carefully,"
chat_prefix += "giving as much information as possible.\n"
prompt = (
chat_prefix
+ "Read the paragraph below and answer the question, using only the information"
Expand Down Expand Up @@ -77,7 +78,7 @@ class OpenAIVanilla(LLMFrameworkInterface): # pylint: disable=too-few-public-me
def __init__(
self, # pylint: disable=super-init-not-called
key: str = os.getenv("OPENAI_API_KEY"),
model_name: str = "gpt-3.5-turbo",
model_name: str = "gpt-3.5-turbo-1106",
vectordb: VectordbInterface = None, # What should this be by default?
) -> None:
"""Sets the API key and initializes library objects if any"""
Expand Down
6 changes: 3 additions & 3 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:
- chatbot
environment:
- CHAT_DOMAIN=${DOMAIN:-"localhost"}
- PROD_DOMAIN=${DOMAIN2:-assistant.bible}
- PROD_DOMAIN=${DOMAIN2:-dev.assistant.bible}
volumes:
- ./nginx/nginx.conf.template:/etc/nginx/templates/default.conf.template:ro
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
Expand All @@ -93,7 +93,7 @@ services:
- ./certbot/conf/:/etc/letsencrypt/:rw
networks:
- chatbot-network

# command: certonly --webroot --webroot-path=/var/www/certbot --email [email protected] --agree-tos --no-eff-email --staging -d dev.assistant.bible
ofelia-scheduler:
image: mcuadros/ofelia:v0.3.7
depends_on:
Expand Down Expand Up @@ -131,4 +131,4 @@ volumes:
logs-vol:
chroma-db:
postgres-db-vol:
postgres-db-backup:
postgres-db-backup:
21 changes: 21 additions & 0 deletions deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
events {
worker_connections 1024;
# other events directives can be placed here
}
http {
server {
listen 80;
listen [::]:80;

server_name [dev.assistant.bible] www.[dev.assistant.bible];
server_tokens off;

location /.well-known/acme-challenge/ {
root /var/www/certbot;
}

location / {
return 301 https://[dev.assistant.bible]$request_uri;
}
}
}

0 comments on commit fd8664a

Please sign in to comment.