Skip to content

Commit

Permalink
Calling the data handler class from main
Browse files Browse the repository at this point in the history
  • Loading branch information
christophlandolt committed Dec 2, 2023
1 parent 564df73 commit d9e99a5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from settings import ProjectSettings
from json_query_engine import QueryEngine
from json_query_engine import json_value, json_schema
from data_handler import DataHandler
if __name__ == '__main__':
print("Project entry point")
# Usage
Expand All @@ -13,8 +14,14 @@
print(config.DB_NAME)
print(config.COLLECTION_NAME)

query_engine = QueryEngine(config.OPENAI_API_KEY, json_value, json_schema)
print(query_engine.get_nl_response("How old is Anna Smith?"))
print(query_engine.get_raw_response("How old is Anna Smith?"))

#query_engine = QueryEngine(config.OPENAI_API_KEY, json_value, json_schema)
#print(query_engine.get_nl_response("How old is Anna Smith?"))
#print(query_engine.get_raw_response("How old is Anna Smith?"))

data_handler = DataHandler(config.DB_SERVER, config.DB_PORT, config.DB_NAME, config.COLLECTION_NAME)
places = data_handler.get_places()
for id, place in places:
print(place)

data_handler.close_connection()

0 comments on commit d9e99a5

Please sign in to comment.