Strip Google AI text responses (#118593)
* Strip Google AI test responses * strip each partpull/118597/head
parent
f3b20d30ae
commit
7af469f81e
|
@ -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…
Reference in New Issue