Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
feature(#30, #29, #59): resolved parameters passing issue on getCompl…
Browse files Browse the repository at this point in the history
…etion Method.
  • Loading branch information
thomas committed May 28, 2023
1 parent d78a075 commit 3c1a286
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/router/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def send_notification():
token = data["token"]
uuid = data["uuid"]

result = getCompletion(query, uuid)
result = getCompletion(query=query, uuid=uuid)

notification = {"title": "alert", "content": result}

Expand Down
4 changes: 3 additions & 1 deletion src/service/llm/chat_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def chat_with_ai(

# TODO: use a model defined elsewhere, so that model can contain
# temperature and other settings we care about
return ChatResponseModel(handle_chat_completion(model=model, messages=current_context))
return ChatResponseModel(
handle_chat_completion(model=model, messages=current_context)
)
except Exception as e:
# TODO: When we switch to langchain, this is built in
logger.warn("Error: ", "API Rate Limit Reached. Waiting 10 seconds...")
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def test_langchain():
error = "Error happened while analyzing your prompt. Please ask me again"
result = getCompletion("open three.js website", TEST_UUID)
result = getCompletion(query="open three.js website", uuid=TEST_UUID)
print(result)
assert result != error

Expand Down

0 comments on commit 3c1a286

Please sign in to comment.