langchain/libs/partners
ccurme c4599444ee
mistralai: update tool calling (#19451)
```python
from langchain.agents import tool
from langchain_mistralai import ChatMistralAI


llm = ChatMistralAI(model="mistral-large-latest", temperature=0)

@tool
def get_word_length(word: str) -> int:
    """Returns the length of a word."""
    return len(word)


tools = [get_word_length]
llm_with_tools = llm.bind_tools(tools)

llm_with_tools.invoke("how long is the word chrysanthemum")
```
currently raises
```
AttributeError: 'dict' object has no attribute 'model_dump'
```

Same with `.with_structured_output`
```python
from langchain_mistralai import ChatMistralAI
from langchain_core.pydantic_v1 import BaseModel

class AnswerWithJustification(BaseModel):
    """An answer to the user question along with justification for the answer."""
    answer: str
    justification: str

llm = ChatMistralAI(model="mistral-large-latest", temperature=0)
structured_llm = llm.with_structured_output(AnswerWithJustification)

structured_llm.invoke("What weighs more a pound of bricks or a pound of feathers")
```

This appears to fix.
2024-03-22 16:03:48 -04:00
..
ai21 ai21[patch]: AI21 Labs bump SDK version (#19114) 2024-03-18 19:47:08 -07:00
airbyte airbyte[patch]: release 0.1.1, python 3.9 compat (#18597) 2024-03-05 19:22:08 +00:00
anthropic anthropic[patch]: update base_url of anthropic (#18634) 2024-03-20 21:04:55 -07:00
astradb astradb: move to langchain-datastax repo (#18354) 2024-03-01 19:04:43 +00:00
elasticsearch elasticsearch: check for deployed models (#18973) 2024-03-18 21:32:00 -07:00
exa docs: Additional examples for partners/exa README (#18081) 2024-02-25 18:53:47 -08:00
fireworks fireworks[patch]: support "any" tool_choice (#18343) 2024-03-01 11:12:28 -08:00
google-genai google-genai, google-vertexai: move to langchain-google (#17899) 2024-02-25 21:58:05 -08:00
google-vertexai google-genai, google-vertexai: move to langchain-google (#17899) 2024-02-25 21:58:05 -08:00
groq langchain_groq[patch]: Invoke callback prior to yielding token (#18272) 2024-02-28 23:43:16 +00:00
ibm ibm[patch]: release 0.1.3 (#19094) 2024-03-14 15:59:42 -07:00
mistralai mistralai: update tool calling (#19451) 2024-03-22 16:03:48 -04:00
mongodb mongodb[patch]: Added scoring threshold to caching (#19286) 2024-03-19 11:30:02 -07:00
nomic
nvidia-ai-endpoints nvidia-trt, nvidia-ai-endpoints: move to repo (#18814) 2024-03-08 19:30:50 +00:00
nvidia-trt nvidia-trt, nvidia-ai-endpoints: move to repo (#18814) 2024-03-08 19:30:50 +00:00
openai openai[patch]: fix core min version (#19366) 2024-03-20 15:38:29 -07:00
pinecone docs: update pinecone README to use PineconeVectorStore (#18170) 2024-03-01 12:12:52 -08:00
robocorp robocorp[patch]: run integration tests on release (#19358) 2024-03-20 19:31:12 +00:00
together docs: update docstring of Together class (#19008) 2024-03-15 16:30:45 -07:00
voyageai voyageai[patch]: init package (#19098) 2024-03-15 00:56:10 +00:00