mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-24 13:07:53 +08:00
Fix conversation return logic in HuggingChat class
This commit is contained in:
@@ -108,14 +108,13 @@ class HuggingChat(AsyncAuthedProvider, ProviderModelMixin):
|
||||
debug.log(f"Conversation created: {json.dumps(conversationId[8:] + '...')}")
|
||||
messageId = cls.fetch_message_id(session, conversationId)
|
||||
conversation.models[model] = {"conversationId": conversationId, "messageId": messageId}
|
||||
if return_conversation:
|
||||
yield conversation
|
||||
inputs = format_prompt(messages)
|
||||
else:
|
||||
conversationId = conversation.models[model]["conversationId"]
|
||||
conversation.models[model]["messageId"] = cls.fetch_message_id(session, conversationId)
|
||||
inputs = get_last_user_message(messages)
|
||||
|
||||
if return_conversation:
|
||||
yield conversation
|
||||
settings = {
|
||||
"inputs": inputs,
|
||||
"id": conversation.models[model]["messageId"],
|
||||
|
||||
Reference in New Issue
Block a user