mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-30 05:25:05 +02:00
remove dockerfile, update readmes
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
FROM python:3.9
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the current directory contents into the container at /app
|
||||
COPY . .
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN pip install poetry && poetry config virtualenvs.create false && poetry install --with test
|
||||
|
||||
RUN poetry run pytest
|
||||
@@ -0,0 +1,48 @@
|
||||
# LangGraph JS/TS SDK
|
||||
|
||||
This repository contains the JS/TS SDK for interacting with the LangGraph REST API.
|
||||
|
||||
## Quick Start
|
||||
|
||||
To get started with the JS/TS SDK, [install the package](https://www.npmjs.com/package/@langchain/langgraph-sdk)
|
||||
|
||||
```bash
|
||||
yarn add @langchain/langgraph-sdk
|
||||
```
|
||||
|
||||
You will need a running LangGraph API server. If you're running a server locally using `langgraph-cli`, SDK will automatically point at `http://localhost:8123`, otherwise
|
||||
you would need to specify the server URL when creating a client.
|
||||
|
||||
```js
|
||||
import { Client } from "@langchain/langgraph-sdk";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
// List all assistants
|
||||
const assistants = await client.assistants.search({
|
||||
metadata: null,
|
||||
offset: 0,
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
// We auto-create an assistant for each graph you register in config.
|
||||
const agent = assistants[0];
|
||||
|
||||
// Start a new thread
|
||||
const thread = await client.threads.create();
|
||||
|
||||
// Start a streaming run
|
||||
const messages = [{ role: "human", content: "whats the weather in la" }];
|
||||
|
||||
const streamResponse = client.runs.stream(
|
||||
thread["thread_id"],
|
||||
agent["assistant_id"],
|
||||
{
|
||||
input: { messages },
|
||||
}
|
||||
);
|
||||
|
||||
for await (const chunk of streamResponse) {
|
||||
console.log(chunk);
|
||||
}
|
||||
```
|
||||
+35
-1
@@ -1 +1,35 @@
|
||||
# langgraph
|
||||
# LangGraph Python SDK
|
||||
|
||||
This repository contains the Python SDK for interacting with the LangGraph REST API.
|
||||
|
||||
## Quick Start
|
||||
|
||||
To get started with the Python SDK, [install the package](https://pypi.org/project/langgraph-sdk/)
|
||||
|
||||
```bash
|
||||
pip install -U langgraph-sdk
|
||||
```
|
||||
|
||||
You will need a running LangGraph API server. If you're running a server locally using `langgraph-cli`, SDK will automatically point at `http://localhost:8123`, otherwise
|
||||
you would need to specify the server URL when creating a client.
|
||||
|
||||
```python
|
||||
from langgraph_sdk import get_client
|
||||
|
||||
# If you're using a remote server, initialize the client with `get_client(url=REMOTE_URL)`
|
||||
client = get_client()
|
||||
|
||||
# List all assistants
|
||||
assistants = await client.assistants.search()
|
||||
|
||||
# We auto-create an assistant for each graph you register in config.
|
||||
agent = assistants[0]
|
||||
|
||||
# Start a new thread
|
||||
thread = await client.threads.create()
|
||||
|
||||
# Start a streaming run
|
||||
input = {"messages": [{"role": "human", "content": "whats the weather in la"}]}
|
||||
async for chunk in client.runs.stream(thread['thread_id'], agent['assistant_id'], input=input):
|
||||
print(chunk)
|
||||
```
|
||||
Reference in New Issue
Block a user