langgraph_client 0.2.2
langgraph_client: ^0.2.2 copied to clipboard
A Dart client for the LangGraph API that enables applications to interact with LangGraph services, threads, assistants, runs, and crons with support for streaming operations.
LangGraph Client #
The langgraph_client
package is a Dart package that provides a client for the LangGraph API. It is based off the LangGraph v.0.1.0
OpenAPI specification.
Both this package and the API itself are still in development and are subject to change.
Features #
The package supports the most vital APIs necessary to interact with the LangGraph API, but does not yet support the entire catalog of endpoints. Support for additional endpoints will be added in the near future.
Getting started #
Add the following to your pubspec.yaml:
dependencies:
langgraph_client: "^0.1.0"
Usage #
Create an instance of the client:
var client = LangGraphClient(
baseUrl: 'http://localhost:52273', // Replace with your LangGraph API URL
);
Create the input:
Thread thread = await client.createThread();
var statefulRequest = RunCreateStateful(
assistantId: 'my-langgraph-agent',
input: {
'messages': [
{
'content': 'Write a Hello World program in Dart',
'role': 'user',
},
]
},
streamMode: 'messages',
);
Call the endpoint:
await for (final sseEvent in client.streamStatefulRun(thread.Id, statefulRequest)) {
print(sseEvent);
}
Social Media #
LinkedIn:
https://www.linkedin.com/in/gerald-parker-b7948050/
Youtube:
https://www.youtube.com/@esoterictech
Additional information #
For more information refer to the LangGraph documentation: