mirror of
https://github.com/father-bot/chatgpt_telegram_bot.git
synced 2026-06-13 03:54:57 +03:00
Missing self from error handler
This commit is contained in:
+2
-2
@@ -44,7 +44,7 @@ class ChatGPT:
|
||||
)
|
||||
answer = r.choices[0].text
|
||||
else:
|
||||
raise ValueError(f"Unknown model: {model}")
|
||||
raise ValueError(f"Unknown model: {self.model}")
|
||||
|
||||
answer = self._postprocess_answer(answer)
|
||||
n_input_tokens, n_output_tokens = r.usage.prompt_tokens, r.usage.completion_tokens
|
||||
@@ -193,4 +193,4 @@ async def generate_images(prompt, n_images=4):
|
||||
|
||||
async def is_content_acceptable(prompt):
|
||||
r = await openai.Moderation.acreate(input=prompt)
|
||||
return not all(r.results[0].categories.values())
|
||||
return not all(r.results[0].categories.values())
|
||||
|
||||
Reference in New Issue
Block a user