Skip to content

Commit

Permalink
print log
Browse files Browse the repository at this point in the history
  • Loading branch information
liufufa committed Mar 21, 2023
1 parent caf7149 commit 2bc0496
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion chatbotv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ def ask_stream(
},
stream=True,
)
print({
"model": self.engine,
"messages": self.conversation[convo_id],
"stream": True,
# kwargs
"temperature": kwargs.get("temperature", self.temperature),
"top_p": kwargs.get("top_p", self.top_p),
"n": kwargs.get("n", self.reply_count),
"user": role,
})
print('resp=' + str(response))
if response.status_code != 200:
print('response error')
Expand Down Expand Up @@ -152,7 +162,6 @@ def ask(self, prompt: str, role: str = "user", convo_id: str = "default", **kwar
"""
Non-streaming ask
"""
print("[ask]")
response = self.ask_stream(
prompt=prompt,
role=role,
Expand Down

0 comments on commit 2bc0496

Please sign in to comment.