Skip to content

Commit

Permalink
Fixes #9, new ENV var for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JolanThomassin committed Feb 8, 2024
1 parent 4c02761 commit b1a769e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

* DB_SERVER_CONTAINER_NAME: The name of your database server container (ex: louis-db-server).

* AILAB_SCHEMA_VERSION: The version of the schema you want to use.

* Run database locally (see bin/postgres.sh)
* Restore latest schema dump

Expand Down
11 changes: 4 additions & 7 deletions bin/generate_qna.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

# Constants
TEST_VERSION = date.today()
REQUIRED_QUESTIONS = 1
REQUIRED_QUESTIONS = 3
CHARACTER_LIMIT = 14383
DEFAULT_STORAGE_PATH = "/home/vscode/finesse-data-2/qna"
DEFAULT_STORAGE_PATH = "../qna-test"
SYSTEM_PROMPT_FILENAME = "qna_system_prompt.txt"
USER_PROMPT_FILENAME = "qna_user_prompt.txt"

Expand Down Expand Up @@ -60,11 +60,8 @@ def generate_question(

with project_db.cursor() as cursor: # Open the cursor here
for i in range(REQUIRED_QUESTIONS):
# Access the LOUIS_SCHEMA environment variable
louis_schema = os.getenv("LOUIS_SCHEMA")

# Extract version part from the schema name
schema_version = re.search(r"(\d+\.\d+\.\d+)", louis_schema).group(1)
# Access the AILAB_SCHEMA_VERSION environment variable
schema_version = os.getenv("AILAB_SCHEMA_VERSION")

random_chunk = get_random_chunk(cursor, schema_version)
if not random_chunk:
Expand Down

0 comments on commit b1a769e

Please sign in to comment.