Bump google-generativeai to 0.6.0 (#119062)

This commit is contained in:
tronikos 2024-06-07 11:50:55 -07:00 committed by GitHub
parent 4a4c98caad
commit ae59d0eadf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View file

@ -4,9 +4,9 @@ from __future__ import annotations
from typing import Any, Literal
import google.ai.generativelanguage as glm
from google.api_core.exceptions import GoogleAPICallError
import google.generativeai as genai
from google.generativeai import protos
import google.generativeai.types as genai_types
from google.protobuf.json_format import MessageToDict
import voluptuous as vol
@ -93,7 +93,7 @@ def _format_tool(tool: llm.Tool) -> dict[str, Any]:
parameters = _format_schema(convert(tool.parameters))
return glm.Tool(
return protos.Tool(
{
"function_declarations": [
{
@ -349,13 +349,13 @@ class GoogleGenerativeAIConversationEntity(
LOGGER.debug("Tool response: %s", function_response)
tool_responses.append(
glm.Part(
function_response=glm.FunctionResponse(
protos.Part(
function_response=protos.FunctionResponse(
name=tool_name, response=function_response
)
)
)
chat_request = glm.Content(parts=tool_responses)
chat_request = protos.Content(parts=tool_responses)
intent_response.async_set_speech(
" ".join([part.text.strip() for part in chat_response.parts if part.text])

View file

@ -9,5 +9,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"quality_scale": "platinum",
"requirements": ["google-generativeai==0.5.4", "voluptuous-openapi==0.0.4"]
"requirements": ["google-generativeai==0.6.0", "voluptuous-openapi==0.0.4"]
}

View file

@ -977,7 +977,7 @@ google-cloud-pubsub==2.13.11
google-cloud-texttospeech==2.12.3
# homeassistant.components.google_generative_ai_conversation
google-generativeai==0.5.4
google-generativeai==0.6.0
# homeassistant.components.nest
google-nest-sdm==4.0.4

View file

@ -803,7 +803,7 @@ google-api-python-client==2.71.0
google-cloud-pubsub==2.13.11
# homeassistant.components.google_generative_ai_conversation
google-generativeai==0.5.4
google-generativeai==0.6.0
# homeassistant.components.nest
google-nest-sdm==4.0.4