mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Strip Google AI text responses (#118593)
* Strip Google AI test responses * strip each part
This commit is contained in:
parent
20159d0277
commit
1afbfd687f
@ -355,7 +355,7 @@ class GoogleGenerativeAIConversationEntity(
|
||||
chat_request = glm.Content(parts=tool_responses)
|
||||
|
||||
intent_response.async_set_speech(
|
||||
" ".join([part.text for part in chat_response.parts if part.text])
|
||||
" ".join([part.text.strip() for part in chat_response.parts if part.text])
|
||||
)
|
||||
return conversation.ConversationResult(
|
||||
response=intent_response, conversation_id=conversation_id
|
||||
|
@ -80,7 +80,7 @@ async def test_default_prompt(
|
||||
mock_chat.send_message_async.return_value = chat_response
|
||||
mock_part = MagicMock()
|
||||
mock_part.function_call = None
|
||||
mock_part.text = "Hi there!"
|
||||
mock_part.text = "Hi there!\n"
|
||||
chat_response.parts = [mock_part]
|
||||
result = await conversation.async_converse(
|
||||
hass,
|
||||
|
Loading…
x
Reference in New Issue
Block a user