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

Passing Graph State to Tool No longer works #1449

Closed
5 tasks done
HiraveBapu opened this issue Aug 23, 2024 · 3 comments
Closed
5 tasks done

Passing Graph State to Tool No longer works #1449

HiraveBapu opened this issue Aug 23, 2024 · 3 comments

Comments

@HiraveBapu
Copy link

HiraveBapu commented Aug 23, 2024

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph/LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

@tool
def state_tool(x: int, state: Annotated[dict, InjectedState]) -> str:
    '''Do something with state.'''
    if len(state["messages"]) > 2:
        return state["foo"] + str(x)
    else:
        return "not enough messages"

@tool
def foo_tool(x: int, foo: Annotated[str, InjectedState("foo")]) -> str:
    '''Do something else with state.'''
    return foo + str(x + 1)

tools = [state_tool,foo_tool]

Error Message and Stack Trace (if applicable)

Invalid argument provided to Gemini: 400 * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[state].properties: should be non-empty for OBJECT type

Description

I am trying to use langchain-google-genai = "^1.0.10", langgraph = "^0.2.12", receiving error

i am using from langchain_google_genai import ChatGoogleGenerativeAI and model gemini-1.5-flash

System Info

python = ">=3.9,<3.13"
uvicorn = "^0.30.6"
langchain-community = "^0.2.12"
langchain-text-splitters = "^0.2.2"
langchain-chroma = "^0.1.3"
distro = "^1.9.0"
langgraph = "^0.2.12"
aiosqlite = "^0.20.0"
watchfiles = "^0.22.0"
filelock = "^3.15.4"
python-multipart = "*"
langchain-core = "^0.2.34"
sentence-transformers = "^3.0.1"
pypdf = "^4.3.0"

gunicorn = "^23.0.0"
pytz = "^2024.1"
tzlocal = "^5.2"
colorama = "^0.4.6"
langgraph-checkpoint-sqlite = "^1.0.0"
grpcio = "1.64.1"
torch = "2.2.2"
tiktoken = "^0.7.0"
langchain-google-genai = "^1.0.10"
pydantic-settings = "^2.4.0"
pandas = "^2.2.2"
openpyxl = "^3.1.5"
pydantic = "^2.8.2"

@gbaian10
Copy link
Contributor

gbaian10 commented Aug 23, 2024

If other LLMs are working and only Google's isn't, I guess this issue might be similar to

If all the LLMs are not working, then it might be need to investigate.

@vbarda
Copy link
Collaborator

vbarda commented Aug 23, 2024

+1, @HiraveBapu can you confirm that this is happening for you with another provider, like openai? if not, it's definitely a google issue

@vbarda
Copy link
Collaborator

vbarda commented Aug 30, 2024

Closing due to inactivity

@vbarda vbarda closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants