We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code output doesn't contain enum field in array items field, which is supported in gemini
from typing import List from langchain_core.tools import tool from langchain_core.utils.function_calling import convert_to_openai_tool from langchain_google_genai._function_utils import convert_to_genai_function_declarations class Color(Enum): RED="RED" GREEN="GREEN" YELLOW="YELLOW" @tool def describe_colors(colors:List[Color]) -> str: """ describe colors """ return "\n".join(colors) print(convert_to_openai_tool(describe_colors)) print(convert_to_genai_function_declarations([describe_colors]))
output:
{'type': 'function', 'function': {'name': 'describe_colors', 'description': 'describe colors', 'parameters': {'properties': {'colors': {'items': {'enum': ['RED', 'GREEN', 'YELLOW'], 'type': 'string'}, 'type': 'array'}}, 'required': ['colors'], 'type': 'object'}}} function_declarations { name: "describe_colors" description: "describe colors" parameters { type_: OBJECT description: "describe colors " properties { key: "colors" value { type_: ARRAY items { type_: STRING description: "Color" } } } required: "colors" } }
expected: enum fields in items field
The text was updated successfully, but these errors were encountered:
I'm running into the same problem
Sorry, something went wrong.
No branches or pull requests
The following code output doesn't contain enum field in array items field, which is supported in gemini
output:
expected:
enum fields in items field
The text was updated successfully, but these errors were encountered: