Skip to content

Commit

Permalink
request model
Browse files Browse the repository at this point in the history
  • Loading branch information
cijiugechu committed Jun 7, 2024
1 parent 1afd007 commit 71110e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def extract_nouns(self, sentence):

return nouns

async def nature2prompt(self, nature2promptreq: models.Nature2PromptResponse):
async def nature2prompt(self, nature2promptreq: models.Nature2PromptRequest):
client = AsyncOpenAI()

n2p_logger = logging.getLogger(__name__)
Expand All @@ -437,7 +437,7 @@ async def nature2prompt(self, nature2promptreq: models.Nature2PromptResponse):
# {"role": "assistant",
# "content":" ",},
{"role": "user",
"content":input_to_bot.filtered_nouns,}
"content":input_to_bot.text,}
# {"role": "assistant",
# "content":" ",},
],
Expand Down
3 changes: 3 additions & 0 deletions modules/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def generate_model(self):
]
).generate_model()

class Nature2PromptRequest(BaseModel):
text: str

class Nature2PromptResponse(BaseModel):
filtered_nouns: str

Expand Down

0 comments on commit 71110e0

Please sign in to comment.