Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Nov 9, 2023
1 parent 1c162fd commit 1c28aea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from google.protobuf import json_format
from prisma import Prisma

from openai_agent import main
from openai_agent import openai

app = FastAPI()
app.include_router(
main.router,
openai.router,
tags=["openai"]
)

Expand Down
2 changes: 1 addition & 1 deletion openai_agent/main.py → openai_agent/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class AzureOpenAIRequest(BaseModel):
async def create_item(request: AzureOpenAIRequest) -> str:
conversation = request.conversation
result = await get_openai_response(conversation)
return result
return result
2 changes: 1 addition & 1 deletion openai_agent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ async def get_openai_response(conversation: List[Dict[str, str]]) -> str:
except Exception as e:
raise HTTPException(status_code=500, detail=f"Internal server error: {e}")
result = completion.choices[0].message.content
return result
return result

0 comments on commit 1c28aea

Please sign in to comment.