Skip to content

v0.7.4

Latest
Compare
Choose a tag to compare
@davidmigloz davidmigloz released this 26 Jul 22:15
· 10 commits to main since this release
d3d0291

2024-07-26

What's New?

🔥 Ollama Tool Support

ChatOllama now offers support for native tool calling with popular models such as Llama 3.1, the latest state-of-the-art model from Meta. This enables a model to answer a given prompt using tool(s) it knows about, making it possible for models to perform more complex tasks or interact with the outside world. It follows the standard LangChain.dart tools API, so you can use it in the same way as you would with other providers that support tool-calling (e.g., ChatOpenAI, ChatAnthropic, etc.).

Explore more:

🔄 Runnable Fallbacks

When working with language models, you may encounter issues from the underlying APIs, such as rate limits or downtime. To enhance reliability in production environments, we've introduced Runnable Fallbacks. This feature allows you to define alternative models or even entirely different chains to use when the primary option fails. Create fallbacks using the withFallbacks() function:

final chatModel = chatOpenAI.withFallbacks([chatAnthropic, chatMistral]);

Check out the full documentation on how to use fallbacks.

🔗 Bind Improvements

We've enhanced the bind functionality to merge options additively across multiple cascade bind calls. This change preserves existing options while allowing specific overrides, providing more flexibility in configuration. Also, LanguageModelOptions (e.g., ChatOpenAIOptions, ChatMistralAIOptions, etc.) no longer specify the default model in the constructor, preventing the model from being reset when using the bind operator.

🌟 OpenAI GPT-4o-mini

A week ago, OpenAI released GPT-4o mini, their most cost-efficient small model. We have now made it the default model for the ChatOpenAI wrapper.

Additionally, you can now disable parallel tool calls and define the service tier in ChatOpenAI.

✨ Mistral New Models

Mistral recently released several powerful models: Mistral Large 2, Mistral NeMo, and Codestral Mamba. o take advantage of these models, use the ChatMistralAI wrapper from the langchain_mistralai package.

final chatModel = ChatMistralAI(
  apiKey: 'your-api-key',
  defaultOptions: ChatMistralAIOptions(
    model: 'mistral-large-latest',
  ),
);

🔧 API Clients Updates

  • ollama_dart: Now supports tool calls, a new API for retrieving the Ollama server version, and extended model information in the model API.
  • openai_dart: Adds support for disabling parallel tool calls and specifying the service tier in the chat completions API, and customising the chunking strategy in the file_search tool and overrides in the assistants API. You can now also customise the OpenAI-Beta header for beta features.

Changes


Packages with breaking changes:

Packages with other changes:


langchain - v0.7.4

  • FEAT: Add Fallback support for Runnables (#501). (5887858d)
  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)
  • DOCS: Update README.md with Ollama tool call support. (e016b0bd)

langchain_core - v0.3.4

  • FEAT: Add Fallback support for Runnables (#501). (5887858d)
  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)

langchain_community - v0.3.0

  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_ollama - v0.3.0

  • FEAT: Add tool calling support in ChatOllama (#505). (6ffde204)
  • BREAKING FEAT: Update Ollama default model to llama-3.1 (#506). (b1134bf1)
  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)
  • DOCS: Update Ollama request options default values in API docs (#479). (e1f93366)

langchain_openai - v0.7.0

  • BREAKING FEAT: Update ChatOpenAI default model to gpt-4o-mini (#507). (c7b8ce91)
  • FEAT: Add support for disabling parallel tool calls in ChatOpenAI (#493). (c46d676d)
  • FEAT: Add GPT-4o-mini to model catalog (#497). (faa23aee)
  • FEAT: Add support for service tier in ChatOpenAI (#495). (af79a4ff)
  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_anthropic - v0.1.1

  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_firebase - v0.2.1

  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_google - v0.6.1

  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_mistralai - v0.2.2

  • FEAT: Implement additive options merging for cascade bind calls (#500). (8691eb21)
  • REFACTOR: Remove default model from the language model options (#498). (44363e43)
  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_chroma - v0.2.1+1

  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_pinecone - v0.1.0+7

  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

langchain_supabase - v0.1.1+1

  • REFACTOR: Depend on exact versions for internal 1st party dependencies (#484). (244e5e8f)

ollama_dart - v0.2.0

  • FEAT: Add tool calling support in ollama_dart (#504). (1ffdb41b)
  • BREAKING FEAT: Update Ollama default model to llama-3.1 (#506). (b1134bf1)
  • FEAT: Add support for Ollama version and model info (#488). (a110ecb7)
  • FEAT: Add suffix support in Ollama completions API in ollama_dart (#503). (30d05a69)
  • BREAKING REFACTOR: Change Ollama push model status type from enum to String (#489). (90c9ccd9)
  • DOCS: Update Ollama request options default values in API docs (#479). (e1f93366)

openai_dart - v0.4.0

  • FEAT: Add support for disabling parallel tool calls in openai_dart (#492). (a91e0719)
  • FEAT: Add GPT-4o-mini to model catalog (#497). (faa23aee)
  • FEAT: Support chunking strategy in file_search tool in openai_dart (#496). (cfa974a9)
  • FEAT: Add support for overrides in the file search tool in openai_dart (#491). (89605638)
  • FEAT: Allow to customize OpenAI-Beta header in openai_dart (#502). (5fed8dbb)
  • FEAT: Add support for service tier in openai_dart (#494). (0838e4b9)

New Contributors


📣 Check out the #announcements channel in the LangChain.dart Discord server for more details.