Releases: davidmigloz/langchain_dart
2024-10-31
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
langchain_openai-v0.7.2+5
openai_dart - v0.4.4
openai_realtime_dart - v0.0.3
2024-10-29
What's New?
I haven't announced the last few releases as much as I used to due to lack of time (I should probably automate it), but we've been quietly working on enhancements and new features!
Here's a summary of the latest updates:
๐ Runnable Retry:
Thanks to @Ganeshsivakumar, you can now effortlessly retry failed runnables.
final chatModel = ChatOpenAI();
final chatModelWithRetry = chatModel.withRetry(maxRetries: 5);
final res = await chatModelWithRetry.invoke(...);Pro-tip: combine with fallbacks for robustness. For example, retry 5 times and then fallback to another model.
final openAi = ChatOpenAI(...);
final anthropic = ChatAnthropic(...);
final chatModel = openAi
.withRetry(maxRetries: 5)
.withFallbacks([anthropic]);Learn more in the docs.
โจ langchain_google package:
- ChatGoogleGenerativeAI now supports code execution
final chatModel = ChatGoogleGenerativeAI(
apiKey: apiKey,
defaultOptions: ChatGoogleGenerativeAIOptions(
model: 'gemini-1.5-flash',
enableCodeExecution: true,
),
);
final res = await chatModel.invoke(
PromptValue.string(
'Calculate the fibonacci sequence up to 10 terms. '
'Return only the last term without explanations.',
),
);
final text = res.output.content;
print(text); // 34
final executableCode = res.metadata['executable_code'] as String;
print(executableCode);
final codeExecutionResult = res.metadata['code_execution_result'] as Map<String, dynamic>;
print(codeExecutionResult);- GoogleGenerativeAIEmbeddings now supports reduced output dimensionality
โจ langchain_openai package:
- Added support for o1-preview and o1-mini models.
โจ langchain_community package:
- ObjectBox integration enhancements: Added
deleteWherefunctionality and updated SDK to v4.0.3 to fix critical iOS exception.
await vectorStore.deleteWhere(
ObjectBoxDocumentProps.metadata.contains('cat'),
);๐ค Default models updates:
- ChatAnthropic: Updated to
claude-3-5-sonnet-20241022. - Ollama and ChatOllama: Updated to
llama-3.2.
๐๐ฅ New Package: openai_realtime_dart
Introducing openai_realtime_dart package, a strongly-typed Dart client for OpenAI Realtime API.
OpenAI recently released a new websocket-based API for low-latency, multi-modal conversational experiences. You can find all the details in the official documentation.
๐ฏ openai_dart client:
- Audio Support: Now available in chat completions (check out the official docs for more details)
final res = await client.createChatCompletion(
request: CreateChatCompletionRequest(
model: ChatCompletionModel.model(
ChatCompletionModels.gpt4oAudioPreview,
),
modalities: [
ChatCompletionModality.text,
ChatCompletionModality.audio,
],
audio: ChatCompletionAudioOptions(
voice: ChatCompletionAudioVoice.alloy,
format: ChatCompletionAudioFormat.wav,
),
messages: [
ChatCompletionMessage.user(
content: ChatCompletionUserMessageContent.string(
'Is a golden retriever a good family dog?',
),
),
],
),
);
final choice = res.choices.first;
final audio = choice.message.audio;
print(audio?.id);
print(audio?.expiresAt);
print(audio?.transcript);
print(audio?.data);
- Support for storing outputs for model distillation and metadata
- Support for multi-modal moderations
- Support for maxCompletionTokens and reasoningTokens (for o1-preview and o1-mini models)
- Support for file search results in assistants API
๐ฏ anthropic_sdk_dart client:
- Support for Computer Use
const request = CreateMessageRequest(
model: Model.model(Models.claude35Sonnet20241022),
messages: [
Message(
role: MessageRole.user,
content: MessageContent.text(
'Save a picture of a cat to my desktop. '
'After each step, take a screenshot and carefully evaluate if you '
'have achieved the right outcome. Explicitly show your thinking: '
'"I have evaluated step X..." If not correct, try again. '
'Only when you confirm a step was executed correctly should '
'you move on to the next one.',
),
),
],
tools: [
Tool.computerUse(displayWidthPx: 1024, displayHeightPx: 768),
Tool.textEditor(),
Tool.bash(),
],
maxTokens: 1024,
);
final res = await client.createMessage(request: request);- Support for Message Batches
- Support for Prompt Caching
Changes
Packages with breaking changes:
Packages with other changes:
langchain_community-v0.3.2+2openai_dart-v0.4.3openai_realtime_dart-v0.0.2langchain_openai-v0.7.2+4
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
langchain_openai-v0.7.2+4
langchain_anthropic - v0.2.0
langchain_community - v0.3.2+2
anthropic_sdk_dart - v0.2.0
- FEAT: Add support for Message Batches in anthropic_sdk_dart (#585). (a41270a0)
- FEAT: Add claude-3-5-sonnet-20241022 to model catalog in anthropic_sdk_dart (#583). (0cc59e13)
- BREAKING FEAT: Add support for prompt caching in anthropic_sdk_dart (#587). (79dabaa5)
- BREAKING FEAT: Add computer use support in anthropic_sdk_dart (#586). (36c4a3e3)
- DOCS: Update anthropic_sdk_dart readme. (78b7bccf)
openai_dart - v0.4.3
- FEAT: Add support for audio in chat completions in openai_dart (#577). (0fb058cd)
- FEAT: Add support for storing outputs for model distillation and metadata in openai_dart (#578). (c9b8bdf4)
- FEAT: Support multi-modal moderations in openai_dart (#576). (45b9f423)
- FIX: submitThreadToolOutputsToRunStream not returning any events (#574). (00803ac7)
- DOCS: Add xAI to list of OpenAI-compatible APIs in openai_dart (#582). (017cb74f)
- DOCS: Fix openai_dart assistants API outdated documentation (#579). (624c4128)
openai_realtime_dart - v0.0.2
New Contributors
Contributors
2024-10-14
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
langchain_openai-v0.7.2+3
openai_realtime_dart - v0.0.1+2
openai_dart - v0.4.2+2
- DOCS: Fix typo in openai_dart. (e7ddd558)
New Contributors
- @josancamon19 made their first contribution in #572
2024-10-09
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
langchain-v0.7.7+1langchain_chroma-v0.2.1+4langchain_community-v0.3.2+1langchain_firebase-v0.2.1+3langchain_google-v0.6.4+1langchain_ollama-v0.3.2+1langchain_openai-v0.7.2+2langchain_pinecone-v0.1.0+10openai_realtime_dart-v0.0.1+1
langchain - v0.7.7+1
langchain_chroma - v0.2.1+4
langchain_community - v0.3.2+1
langchain_firebase - v0.2.1+3
langchain_google - v0.6.4+1
langchain_ollama - v0.3.2+1
langchain_openai - v0.7.2+2
langchain_pinecone - v0.1.0+10
openai_realtime_dart - v0.0.1+1
- DOCS: Add note about the openai_dart client. (26de8d97)
2024-10-08
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
New packages:
Packages with other changes:
langchain - v0.7.7
langchain_google - v0.6.4
openai_realtime_dart - v0.0.1
openai_dart - v0.4.2+1
- DOCS: Add note about the new openai_realtime_dart client. (44672f0a)
2024-09-25
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
langchain-v0.7.6langchain_core-v0.3.6langchain_community-v0.3.2langchain_firebase-v0.2.1+2langchain_google-v0.6.3+1langchain_ollama-v0.3.2langchain_openai-v0.7.2ollama_dart-v0.2.2openai_dart-v0.4.2langchain_supabase-v0.1.1+3langchain_pinecone-v0.1.0+9langchain_anthropic-v0.1.1+2langchain_chroma-v0.2.1+3langchain_mistralai-v0.2.3+1
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
langchain_supabase-v0.1.1+3langchain_pinecone-v0.1.0+9langchain_anthropic-v0.1.1+2langchain_chroma-v0.2.1+3langchain_mistralai-v0.2.3+1vertex_ai-v0.1.0+2
langchain - v0.7.6
langchain_core - v0.3.6
langchain_community - v0.3.2
- FEAT: Add support for deleteWhere in ObjectBoxVectorStore (#552). (90918bba)
- REFACTOR: Add stubs for ObjectBox on web platform (#553). (41caed92)
langchain_firebase - v0.2.1+2
langchain_google - v0.6.3+1
- FEAT: Add support for reduced output dimensionality in GoogleGenerativeAIEmbeddings (#544). (d5880704)
- DOCS: Update Google's models in documentation (#551). (1da543f7)
langchain_ollama - v0.3.2
langchain_openai - v0.7.2
- FEAT: Add OpenAI o1-preview and o1-mini to model catalog (#555). (9ceb5ff9)
- REFACTOR: Migrate ChatOpenAI to maxCompletionTokens (#557). (08057a5b)
ollama_dart - v0.2.2
openai_dart - v0.4.2
- FEAT: Add OpenAI o1-preview and o1-mini to model catalog (#555). (9ceb5ff9)
- FEAT: Add support for maxCompletionTokens and reasoningTokens in openai_dart (#556). (37d75b61)
- FEAT: Option to include file search results in assistants API (#543). (e916ad3c)
Contributors
v0.7.5
2024-08-22
What's New?
โจ OpenAI's Structured Outputs
The ChatOpenAI wrapper now supports OpenAI's Structured Outputs. This allows you to provide a JSON Schema to guide the model's responses, ensuring they adhere to your desired JSON format. You can simply provide the schema for guidance, or enable strict mode to guarantee the model's output matches the schema exactly, so you don't need to worry about the model omitting a required key, or hallucinating an invalid enum value. Mind that only a subset of JSON Schema is supported when strict is enabled.
final chatModel = ChatOpenAI(
apiKey: openaiApiKey,
defaultOptions: ChatOpenAIOptions(
model: 'gpt-4o',
responseFormat: ChatOpenAIResponseFormat.jsonSchema(
ChatOpenAIJsonSchema(
name: 'Companies',
description: 'A list of companies',
strict: true,
schema: {
'type': 'object',
'properties': {
// your schema definition
},
'additionalProperties': false,
},
),
),
),
);Strict mode is also available when working with tools. ToolSpec now has a strict field that you can set it to true to enable it.
Read more about how it works internally in their announcement blog post and how to use it in LangChain.dart in the ChatOpenAI documentation.
๐ค ToolsAgent: A Generic Tool-Calling Agent
While we're working on porting LangGraph to Dart, we've refactored OpenAIToolsAgent into a new, more versatile ToolsAgent. This generic agent can be used with any model that supports tool-calling, including ChatOllama, ChatOpenAI, ChatAnthropic, and more. Check out the docs for more info.
To migrate from OpenAIToolsAgent to ToolsAgent just run:
dart fix --apply๐ ๏ธ Other Improvements
- All
RunnableOptionssubclasses now have a convenientcopyWithmethod for easier modification. ChatOpenAInow includes log probabilities (logprobs) in the result metadata, offering more context for analysis.- Removed the
OpenAI-Betaheader inChatOpenAIto prevent CORS issues when using OpenRouter. - Added
gpt-4o-2024-08-06andchatgpt-4o-latestto the model catalog inChatOpenAI. - Added support for
min_pinChatOllama, providing more control over the sampling process.
๐ก Introducing Code Assist AI
Thanks to the team at CommandDash, we now have a dedicated AI chatbot to help you with LangChain.dart! This chatbot can answer your questions, provide documentation links, and even generate code snippets. Try it out here:
๐ง API Clients Updates
openai_dart: Now supports OpenAI's Structured Outputs.ollama_dart: Now supports themin_pparameter for finer control over sampling.
Changes
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
langchain-v0.7.5langchain_core-v0.3.5langchain_community-v0.3.1langchain_openai-v0.7.1langchain_ollama-v0.3.1langchain_google-v0.6.2langchain_mistralai-v0.2.3ollama_dart-v0.2.1openai_dart-v0.4.1langchain_firebase-v0.2.1+1langchain_supabase-v0.1.1+2langchain_pinecone-v0.1.0+8langchain_anthropic-v0.1.1+1langchain_chroma-v0.2.1+2
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
langchain_firebase-v0.2.1+1langchain_supabase-v0.1.1+2langchain_pinecone-v0.1.0+8langchain_anthropic-v0.1.1+1langchain_chroma-v0.2.1+2
langchain - v0.7.5
- FEAT: Add ToolsAgent for models with tool-calling support (#530). (f3ee5b44)
- FEAT: Deprecate OpenAIToolsAgent in favour of ToolsAgent (#532). (68d8011a)
- DOCS: Add Code Assist AI in README and documentation (#538). (e752464c)
langchain_core - v0.3.5
- FEAT: Add copyWith method to all RunnableOptions subclasses (#531). (42c8d480)
- FEAT: Support OpenAI's strict mode for tool calling in ChatOpenAI (#536). (71623f49)
- FEAT: Deprecate OpenAIToolsAgent in favour of ToolsAgent (#532). (68d8011a)
langchain_community - v0.3.1
langchain_openai - v0.7.1
- FEAT: Add support for Structured Outputs in ChatOpenAI (#526). (c5387b5d)
- FEAT: Handle refusal in OpenAI's Structured Outputs API (#533). (f4c4ed99)
- FEAT: Include logprobs in result metadata from ChatOpenAI (#535). (1834b3ad)
- FEAT: Add chatgpt-4o-latest to model catalog (#527). (ec82c760)
- FEAT: Add gpt-4o-2024-08-06 to model catalog (#522). (563200e0)
- FEAT: Deprecate OpenAIToolsAgent in favour of ToolsAgent (#532). (68d8011a)
- REFACTOR: Don't send OpenAI-Beta header in ChatOpenAI (#511). (0e532bab)
langchain_ollama - v0.3.1
- FEAT: Add support for min_p in Ollama (#512). (e40d54b2)
- FEAT: Add copyWith method to all RunnableOptions subclasses (#531). (42c8d480)
langchain_google - v0.6.2
langchain_mistralai - v0.2.3
openai_dart - v0.4.1
v0.7.4
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:
- ChatOllama documentation
- Example: Answering questions with data from an external API
- Example: Extracting structured data with tools
๐ 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-Betaheader for beta features.
Changes
Packages with breaking changes:
langchain_community-v0.3.0langchain_ollama-v0.3.0langchain_openai-v0.7.0ollama_dart-v0.2.0openai_dart-v0.4.0
Packages with other changes:
langchain-v0.7.4langchain_anthropic-v0.1.1langchain_chroma-v0.2.1+1langchain_core-v0.3.4langchain_firebase-v0.2.1langchain_google-v0.6.1langchain_mistralai-v0.2.2langchain_pinecone-v0.1.0+7langchain_supabase-v0.1.1+1
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...
v0.7.3
2024-07-02
What's New?
๐ฅ Anthropic Integration
Introducing the new langchain_anthropic package, which provides support for the ChatAnthropic chat model wrapper to consume the Anthropic's Messages API. This integration gives you access to cutting-edge models such as Claude 3.5 Sonnet, which sets new standards in reasoning, knowledge and coding, while offering enhanced capabilities in image understanding, data analysis and writing.
final chatModel = ChatAnthropic(
apiKey: 'yourApiKey',
defaultOptions: ChatAnthropicOptions(
model: 'claude-3-5-sonnet-20240620',
),
);ChatAnthropic supports streaming and tool calling. For more information, check out the docs.
๐ Tavily Search Integration
Connect your LLMs to the web with the new Tavily integration, a search engine optimized for LLMs and RAG.
TavilySearchResultsTool: returns a list of real-time, accurate, and factual search results for a query.TavilyAnswerTool: returns a direct answer for a query.
๐ค Google AI and VertexAI for Firebase
- Both
ChatFirebaseVertexAIandChatGoogleGenerativeAInow utilize thegemini-1.5-flashmodel by default. - Added MIME type support, allowing you to force the model to reply using JSON.
ChatFirebaseVertexAInow supports Firebase Auth.ChatFirebaseVertexAInow correctly reports usage metadata.
๐ Tool calling improvements
- You can now use
ChatToolChoice.requiredto enforce the use of at least one tool, without specifying a particular one.
๐ Documentation Updates
- We've heard your feedback about the difficulty in finding all supported integrations and their corresponding packages. Now, you can easily locate this information in one place.
๐งฉ API Clients Releases
- A new tavily_dart client is available for consuming the Tavily API.
- The anthropic_sdk_dart client now supports tool use, including streaming tools.
Changes
New packages:
Packages with breaking changes:
Packages with other changes:
langchain-v0.7.3langchain_core-v0.3.3langchain_community-v0.2.2langchain_chroma-v0.2.1langchain_mistralai-v0.2.1langchain_ollama-v0.2.2+1langchain_openai-v0.6.3langchain_pinecone-v0.1.0+6langchain_supabase-v0.1.1anthropic_sdk_dart-v0.1.0googleai_dart-v0.1.0+2mistralai_dart-v0.0.3+3ollama_dart-v0.1.2openai_dart-v0.3.3+1
langchain - v0.7.3
Note: Anthropic integration (
ChatAnthropic) is available in the newlangchain_anthropicpackage.
- FEAT: Add support for TavilySearchResultsTool and TavilyAnswerTool (#467). (a9f35755)
- DOCS: Document existing integrations in README.md. (cc4246c8)
langchain_core - v0.3.3
- FEAT: Add support for ChatToolChoiceRequired (#474). (bf324f36)
- FEAT: Update ChatResult.id concat logic (#477). (44c7fafd)
langchain_community - v0.2.2
langchain_anthropic - v0.1.0
langchain_firebase - v0.2.0
Note:
ChatFirebaseVertexAInow usesgemini-1.5-flashmodel by default.
- BREAKING FEAT: Update ChatFirebaseVertexAI default model to gemini-1.5-flash (#458). (d3c96c52)
- FEAT: Add support for ChatToolChoiceRequired (#474). (bf324f36)
- FEAT: Support response MIME type in ChatFirebaseVertexAI (#461) (#463). (c3452721)
- FEAT: Add support for Firebase Auth in ChatFirebaseVertexAI (#460). (6d137290)
- FEAT: Add support for usage metadata in ChatFirebaseVertexAI (#457). (2587f9e2)
- REFACTOR: Simplify how tools are passed to the internal Firebase client (#459). (7f772396)
langchain_google - v0.6.0
Note:
ChatGoogleGenerativeAInow usesgemini-1.5-flashmodel by default.
- BREAKING FEAT: Update ChatGoogleGenerativeAI default model to gemini-1.5-flash (#462). (c8b30c90)
- FEAT: Add support for ChatToolChoiceRequired (#474). (bf324f36)
- FEAT: Support response MIME type and schema in ChatGoogleGenerativeAI (#461). (e258399e)
- REFACTOR: Migrate conditional imports to js_interop (#453). (a6a78cfe)
langchain_openai - v0.6.3
langchain_ollama - v0.2.2+1
- DOCS: Update ChatOllama API docs. (cc4246c8)
langchain_chroma - v0.2.1
- Update a dependency to the latest release.
langchain_mistralai - v0.2.1
- Update a dependency to the latest release.
langchain_pinecone - v0.1.0+6
- Update a dependency to the latest release.
langchain_supabase - v0.1.1
- Update a dependency to the latest release.
anthropic_sdk_dart - v0.1.0
v0.7.2
2024-06-01
What's New?
๐ฅ ObjectBox Vector Search
We are excited to announce that Langchain.dart now supports ObjectBox as a vector store!
ObjectBox is an embedded database that runs inside your application. With the release of v4.0.0, it now supports storing and querying vectors. Leveraging the HNSW algorithm, ObjectBox provides fast and efficient vector search without keeping all the vectors in-memory, making it the first scalable on-device vector database for Dart/Flutter applications.
Check out the ObjectBoxVectorStore documentation to learn how to use it.
final vectorStore = ObjectBoxVectorStore(
embeddings: OllamaEmbeddings(model: 'jina/jina-embeddings-v2-small-en'),
dimensions: 512,
);We have also introduced a new example showcasing a fully local Retrieval Augmented Generation (RAG) pipeline with Llama 3, utilizing ObjectBox and Ollama:
โจ Runnable.close
You now have the ability to close any resources associated with a Runnable by invoking the close method. For instance, if you have a chain like:
final chain = promptTemplate
.pipe(model)
.pipe(outputParser);
// ...
chain.close();Calling close() will propagate the close() call to each Runnable instance within the chain. In this example, it won't affect promptTemplate and outputParser as they have no associated resources to close, but it will effectively close the HTTP client of the model.
๐ Documentation Migration: langchaindart.dev
We have successfully migrated our documentation to a new domain: langchaindart.dev.
๐ ๏ธ Bugfixes
- Errors are now correctly propagated to the stream listener when streaming a chain that uses a
StringOutputParser. - The Ollama client now properly handles buffered stream responses, such as when utilizing Cloudflare Tunnels.
๐ anthropic_sdk_dart client
We are working on integrating Anthropic into LangChain.dart. As part of this effort, we have released a new client for the Anthropic API: anthropic_sdk_dart. In the next release, we will add support for tool calling and further integrate it into LangChain.dart.
Changes
New packages:
Packages with other changes:
langchain-v0.7.2langchain_core-v0.3.2langchain_community-v0.2.1langchain_chroma-v0.2.0+5langchain_firebase-v0.1.0+2langchain_google-v0.5.1langchain_mistralai-v0.2.1langchain_ollama-v0.2.2langchain_openai-v0.6.2langchain_pinecone-v0.1.0+5langchain_supabase-v0.1.0+5chromadb-v0.2.0+1googleai_dart-v0.1.0+1mistralai_dart-v0.0.3+2ollama_dart-v0.1.1openai_dart-v0.3.3vertex_ai-v0.1.0+1
langchain - v0.7.2
- FEAT: Add support for ObjectBoxVectorStore (#438). (81e167a6)
- Check out the ObjectBoxVectorStore documentation
- REFACTOR: Migrate to langchaindart.dev domain (#434). (358f79d6)
langchain_core - v0.3.2
- FEAT: Add Runnable.close() to close any resources associated with it (#439). (4e08cced)
- FIX: Stream errors are not propagated by StringOutputParser (#440). (496b11cc)
langchain_community - v0.2.1
- FEAT: Add support for ObjectBoxVectorStore (#438). (81e167a6)
- Check out the ObjectBoxVectorStore documentation
langchain_openai - v0.6.2
anthropic_sdk_dart - v0.0.1
ollama_dart - v0.1.1
openai_dart - v0.3.3
- FEAT: Support FastChat OpenAI-compatible API (#444). (ddaf1f69)
- FIX: Make vector store name optional (#436). (29a46c7f)
- FIX: Fix deserialization of sealed classes (#435). (7b9cf223)
New Contributors
- @alfredobs97 made their first contribution in #433
๐ฃ Check out the #announcements channel in the LangChain.dart Discord server for more details.


