Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Nov 9, 2023
1 parent d1b35e3 commit 36f825d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def search(
return campaign_data


async def get_openai_response(conversation: List[Dict[str, str]]):
async def get_openai_response(conversation: List[Dict[str, str]]) -> str:
try:
messages = [{"role": "system","content": SYSTEM_PROMPT}] + conversation
completion = await azure_openai_client.chat.completions.create(
Expand All @@ -237,7 +237,7 @@ class AzureOpenAIRequest(BaseModel):

# Route 5: Connect to OpenAI and get response
@app.post("/conversation")
async def create_item(request: AzureOpenAIRequest):
async def create_item(request: AzureOpenAIRequest) -> str:
conversation = request.conversation
result = await get_openai_response(conversation)
return result
Expand Down

0 comments on commit 36f825d

Please sign in to comment.