admin管理员组文章数量:1401764
I am using Google VertexAI gemini-2.0-flash
with LangChain. I keep getting InvalidArgument: 400 Request contains an invalid argument
error when making ainvoke
, astream
and with_structured_output
to the APIs:
2025-03-22 15:57:08 WARNING Retrying langchain_google_vertexai.chat_models._acompletion_with_retry.<locals>._completion_with_retry_inner in 4.0 seconds as it raised InvalidArgument: 400 Unable to submit request because at least one contents field is required. Learn more: .
I have tried the following:
await email_parser_chain.ainvoke({"message": message})
await email_parser_chain.ainvoke({"message": [{"role": "user", "content": message}]}
async for event in agent.astream(
{"messages": [{"role": "user", "content": messages}]},
stream_mode="values", # Use this to stream all values in the state after each step.
config=config, # This is needed by Checkpointer
):
event["messages"][-1].pretty_print()
but to no avail!
本文标签: py langchainGoogle VertexAI InvalidArgument 400 Request contains an invalid argumentStack Overflow
版权声明:本文标题:py langchain - Google VertexAI InvalidArgument: 400 Request contains an invalid argument - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744321968a2600544.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论