Comments (1)
Hello, thank you for reporting this.
I was able to reproduce the issue. I believe it is resolved by omitting streaming=True
when initializing the chat model.
This remains a bug but hopefully that will fix your use-case. Let me know if you continue to experience issues.
Minimal example:
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import tool
from langchain_groq import ChatGroq
@tool
def magic_function(input: int) -> int:
"""Applies a magic function to an input."""
return input + 2
tools = [magic_function]
llm = ChatGroq(model="llama-3.1-70b-versatile").bind_tools(tools)
prompt = ChatPromptTemplate.from_messages(
[
("system","You are a helpful Search Assistant"),
("human","{input}"),
("placeholder","{agent_scratchpad}"),
]
)
agent = create_tool_calling_agent(llm, tools, prompt)
agent_executor = AgentExecutor(
agent=agent, tools=tools, verbose=False,
)
events = []
async for event in agent_executor.astream_events(
{"input": "what is the value of magic_function(3)?"},
version="v1",
):
events.append(event)
from langchain.
Related Issues (20)
- list index out of range for agents
- ChatGoogleGenerativeAI:TypeError: Parameter to MergeFrom() must be instance of same class: expected google.ai.generativelanguage.v1beta.FunctionDeclaration got FunctionDeclaration. When trying to bind @tools HOT 4
- No option available instead of path to create object GoogleApiClient
- PyPDFLoader introduces additional white spaces before umlauts in the middle of the word HOT 2
- Question: Does API Chain support post method?
- IndexOptionsConflict error in AzureCosmosDBSemanticCache when using multiple chat models.
- chatchat kb -r failed
- DOC: <Issue related to /v0.2/docs/how_to/output_parser_xml/> the spelling mistake trained in first paragraph
- Supabase vectorstore uses different schema from docs
- langchain-airbyte: Please bump Python 3.12 version limit
- Prevent Infinite Tool Call Loop in Customer Support Agent (LangGraph)
- DOC: <Issue related to /v0.2/docs/integrations/text_embedding/nomic/>
- Python 3.13 needs Numpy > 2.0
- ExperimentalMarkdownSyntaxTextSplitter missing in __init__
- safe_mode Parameter in ChatMistralAI Class Should Not Be Set to False by default or safe_prompt body parameter not sent to mistral api
- AttributeError: 'tuple' object has no attribute 'acall' with PropertyGraphIndex HOT 1
- pgvector - (psycopg.DataError) PostgreSQL text fields cannot contain NUL (0x00) bytes
- `get_num_tokens_from_message` will cause 302 Redirect on specific image in message list
- BedrockLLM throws LangChainTraver.on_llm_end callback error
- Can't use mustache/jinja2 templates with an argument named "template"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langchain.