Skip to content
New issue

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

Gemini KeyError: 'type' Updating from thread EXCEPTION: 'type' State updated: idle #129

Open
datrip opened this issue Jun 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@datrip
Copy link

datrip commented Jun 12, 2024

Error after adding my gemini API key and trying to do a simple prompt "test" and clicking send:

HISTORY DB C:\Python312\Lib\site-packages\gpt_computer_assistant\utils\artifacts\history_default.db
C:\Python312\Lib\site-packages\langchain_community\chat_message_histories\sql.py:141: LangChainDeprecationWarning: connection_string was deprecated in LangChain 0.2.2 and will be removed in 0.3.0. Use Use connection instead instead.
warn_deprecated(
LLM INPUT test
HISTORY DB C:\Python312\Lib\site-packages\gpt_computer_assistant\utils\artifacts\history_default.db
Error in process_text 'type'
Traceback (most recent call last):
File "C:\Python312\Lib\site-packages\gpt_computer_assistant\agent\process.py", line 220, in process_text
llm_output = assistant(
^^^^^^^^^^
File "C:\Python312\Lib\site-packages\gpt_computer_assistant\agent\assistant.py", line 177, in assistant
msg = get_agent_executor().invoke(
^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\gpt_computer_assistant\agent\agent.py", line 63, in get_agent_executor
return chat_agent_executor.create_tool_calling_executor(get_model(), tools)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langgraph\prebuilt\chat_agent_executor.py", line 369, in create_react_agent
model = model.bind_tools(tool_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langchain_google_genai\chat_models.py", line 966, in bind_tools
genai_tools = [tool_to_dict(convert_to_genai_function_declarations(tools))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langchain_google_genai_function_utils.py", line 65, in convert_to_genai_function_declarations
return convert_to_genai_function_declarations({"function_declarations": tool})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langchain_google_genai_function_utils.py", line 69, in convert_to_genai_function_declarations
_convert_to_genai_function(fc) for fc in tool["function_declarations"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langchain_google_genai_function_utils.py", line 105, in _convert_to_genai_function
return _convert_tool_to_genai_function(fc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\langchain_google_genai_function_utils.py", line 139, in convert_tool_to_genai_function
"type
": TYPE_ENUM[v["type"]],
~^^^^^^^^
KeyError: 'type'
Updating from thread EXCEPTION: 'type'
State updated: idle

OS: Win11

@onuratakan onuratakan added the bug Something isn't working label Jun 14, 2024
@onuratakan onuratakan self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants