Comments (4)
This seems to be fixed in langchain 0.2.2
from langchain.
This seems to be fixed in langchain 0.2.2
No, I upgraded to 0.2.3, and using the official example, assert generation is not None
from langchain.agents import create_tool_calling_agent,AgentExecutor
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
if __name__ == '__main__':
llm = ChatOpenAI(...)
@tool
def magic_function(input: int) -> int:
"""Applies a magic function to an input."""
return input + 2
tools = [magic_function]
query = "what is the value of magic_function(3)?"
prompt = ChatPromptTemplate.from_messages(
[
("system", "You are a helpful assistant"),
("human", "{input}"),
# Placeholders fill up a **list** of messages
("placeholder", "{agent_scratchpad}"),
]
)
agent = create_tool_calling_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools)
agent_executor.invoke({"input": query})
Related version
langchain==0.2.3
langchain-community==0.2.3
langchain-core==0.2.3
langchain-openai==0.1.8
from langchain.
I cannot seem to replicate the error, even after upgrading to 0.2.3. How are you creating llm
? Also could you please clarify what the "official example" is?
from langchain.
I cannot seem to replicate the error, even after upgrading to 0.2.3. How are you creating
llm
? Also could you please clarify what the "official example" is?
I re-edited the sample code in my last answer, which is a demo from the dependency library comments。
from langchain.
Related Issues (20)
- OpenAI callback is deceiving when used with Azure OpenAI HOT 1
- RunnableParallel input schema is empty if children runnable input schemas use TypedDict's HOT 1
- 'KeyError: 400' occurs when using langchain_community.agent_toolkits.openapi.spec.reduce_openapi_spec.
- how to specify a seed when calling the chatopenai model to ensure the stability of the output results.
- Configurable Fields Not available after bind_tools called on Runnable HOT 2
- Support scalar field indexing for milvus collection creation HOT 5
- mxbai-embed-large embedding not consistent with original paper
- 500 error when using GitHubAPIWrapper with GitHub Enterprise
- KeyError with RunnableWithMessageHistory and LangServe: Missing Variable
- AIMessageChunk merge is failing HOT 2
- [Embedding] The dimensions parameter of OpenAIEmbeddings is not working HOT 4
- LangChain Agent Fails to Recognize Tool Names with Descriptions and Incomplete Operation Addition
- UnstructuredMarkdownLoader PermissionError: [Errno 13] Permission denied HOT 4
- Moonshot 0.2.7 has problem : AttributeError: 'Moonshot' object has no attribute '_client', When I back to 0.2.6 is OK!
- DOC: <Issue related to /v0.2/docs/integrations/text_embedding/baidu_qianfan_endpoint/> HOT 1
- Passing tool output back to model doesn't work for OllamaFunctions HOT 1
- DOC: Missing input variables for FewShotChatMessagePromptTemplate HOT 3
- SQLDatabaseChain generated query returns incorrect result, and different from when the query is executed directly on the db
- Neo4jVector doesn't work well with HuggingFaceEmbeddings when reusing the graph HOT 3
- Several unstructed loader throwing PermissionError: [Errno 13] ( unstructuredMarkdownloader , unstructruedEmailLoader .. )
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.