langchain/libs/partners
ccurme 4b6b0a87b6
groq[patch]: Make stream robust to ToolMessage (#20417)
```python
from langchain.agents import AgentExecutor, create_tool_calling_agent, tool
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_groq import ChatGroq


prompt = ChatPromptTemplate.from_messages(
    [
        ("system", "You are a helpful assistant"),
        ("human", "{input}"),
        MessagesPlaceholder("agent_scratchpad"),
    ]
)

model = ChatGroq(model_name="mixtral-8x7b-32768", temperature=0)

@tool
def magic_function(input: int) -> int:
    """Applies a magic function to an input."""
    return input + 2

tools = [magic_function]


agent = create_tool_calling_agent(model, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

agent_executor.invoke({"input": "what is the value of magic_function(3)?"})
```
```
> Entering new AgentExecutor chain...

Invoking: `magic_function` with `{'input': 3}`


5The value of magic\_function(3) is 5.

> Finished chain.
{'input': 'what is the value of magic_function(3)?',
 'output': 'The value of magic\\_function(3) is 5.'}
```
2024-04-13 15:40:55 -07:00
..
ai21 partner[ai21]: masking of the api key for ai21 models (#20257) 2024-04-12 20:19:31 +00:00
airbyte
anthropic multiple: standard chat model tests (#20359) 2024-04-11 18:23:13 -07:00
astradb Revert "community: added partners/package-name folders" (#19662) 2024-03-27 17:09:30 +00:00
chroma chroma: release 0.1.0 (#20355) 2024-04-11 12:39:52 -07:00
cohere cohere: move package to external repo (#20081) 2024-04-05 14:29:15 -07:00
elasticsearch elasticsearch[patch]: move to repo (#19620) 2024-03-28 08:54:57 -07:00
exa
fireworks multiple: standard chat model tests (#20359) 2024-04-11 18:23:13 -07:00
google-genai Revert "community: added partners/package-name folders" (#19662) 2024-03-27 17:09:30 +00:00
google-vertexai Revert "community: added partners/package-name folders" (#19662) 2024-03-27 17:09:30 +00:00
groq groq[patch]: Make stream robust to ToolMessage (#20417) 2024-04-13 15:40:55 -07:00
ibm ibm[patch]: release 0.1.3 (#19094) 2024-03-14 15:59:42 -07:00
mistralai release anthropic, fireworks, openai, groq, mistral (#20333) 2024-04-11 09:19:52 -07:00
mongodb community[patch], mongodb[patch]: Stop spamming SIMD import warnings (#19531) 2024-03-28 03:11:02 +00:00
nomic
nvidia-ai-endpoints Revert "community: added partners/package-name folders" (#19662) 2024-03-27 17:09:30 +00:00
nvidia-trt Revert "community: added partners/package-name folders" (#19662) 2024-03-27 17:09:30 +00:00
openai release anthropic, fireworks, openai, groq, mistral (#20333) 2024-04-11 09:19:52 -07:00
pinecone pinecone[patch]: fix core min version (#20177) 2024-04-08 20:06:59 +00:00
robocorp robocorp[patch]: fix core min version (#19879) 2024-04-01 11:34:14 -07:00
together together: release 0.1.0 (#20225) 2024-04-09 12:23:52 -07:00
voyageai voyageai[patch]: top level reranker import (#19645) 2024-03-28 06:37:55 +00:00