Skip to content

Commit 7b7ee9d

Browse files
authored
oss(langgraph): clarify baseUrl use (#1655)
- Clarify how to update the `baseUrl` parameter for custom host/port configurations in Studio - Add concrete example showing the URL format - Fix casing from `baseURL` to `baseUrl` to match actual query parameter
1 parent 0773246 commit 7b7ee9d

File tree

1 file changed

+61
-57
lines changed

1 file changed

+61
-57
lines changed

src/oss/langgraph/local-server.mdx

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,18 @@ The `langgraph dev` command starts Agent Server in an in-memory mode. This mode
129129
> - LangGraph Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
130130
```
131131

132-
For an Agent Server running on a custom host/port, update the baseURL parameter.
132+
For an Agent Server running on a custom host/port, update the `baseUrl` query parameter in the URL. For example, if your server is running on `http://myhost:3000`:
133+
134+
```
135+
https://smith.langchain.com/studio/?baseUrl=http://myhost:3000
136+
```
133137

134138
<Accordion title="Safari compatibility">
135-
Use the `--tunnel` flag with your command to create a secure tunnel, as Safari has limitations when connecting to localhost servers:
139+
Use the `--tunnel` flag with your command to create a secure tunnel, as Safari has limitations when connecting to localhost servers:
136140

137-
```shell
138-
langgraph dev --tunnel
139-
```
141+
```shell
142+
langgraph dev --tunnel
143+
```
140144
</Accordion>
141145

142146
## 7. Test the API
@@ -145,60 +149,60 @@ For an Agent Server running on a custom host/port, update the baseURL parameter.
145149
<Tabs>
146150
<Tab title="Python SDK (async)">
147151
1. Install the LangGraph Python SDK:
148-
```shell
149-
pip install langgraph-sdk
150-
```
152+
```shell
153+
pip install langgraph-sdk
154+
```
151155
2. Send a message to the assistant (threadless run):
152-
```python
153-
from langgraph_sdk import get_client
154-
import asyncio
155-
156-
client = get_client(url="http://localhost:2024")
157-
158-
async def main():
159-
async for chunk in client.runs.stream(
160-
None, # Threadless run
161-
"agent", # Name of assistant. Defined in langgraph.json.
162-
input={
163-
"messages": [{
164-
"role": "human",
165-
"content": "What is LangGraph?",
166-
}],
167-
},
168-
):
169-
print(f"Receiving new event of type: {chunk.event}...")
170-
print(chunk.data)
171-
print("\n\n")
172-
173-
asyncio.run(main())
174-
```
156+
```python
157+
from langgraph_sdk import get_client
158+
import asyncio
159+
160+
client = get_client(url="http://localhost:2024")
161+
162+
async def main():
163+
async for chunk in client.runs.stream(
164+
None, # Threadless run
165+
"agent", # Name of assistant. Defined in langgraph.json.
166+
input={
167+
"messages": [{
168+
"role": "human",
169+
"content": "What is LangGraph?",
170+
}],
171+
},
172+
):
173+
print(f"Receiving new event of type: {chunk.event}...")
174+
print(chunk.data)
175+
print("\n\n")
176+
177+
asyncio.run(main())
178+
```
175179
</Tab>
176180
<Tab title="Python SDK (sync)">
177181
1. Install the LangGraph Python SDK:
178-
```shell
179-
pip install langgraph-sdk
180-
```
182+
```shell
183+
pip install langgraph-sdk
184+
```
181185
2. Send a message to the assistant (threadless run):
182-
```python
183-
from langgraph_sdk import get_sync_client
184-
185-
client = get_sync_client(url="http://localhost:2024")
186-
187-
for chunk in client.runs.stream(
188-
None, # Threadless run
189-
"agent", # Name of assistant. Defined in langgraph.json.
190-
input={
191-
"messages": [{
192-
"role": "human",
193-
"content": "What is LangGraph?",
194-
}],
195-
},
196-
stream_mode="messages-tuple",
197-
):
198-
print(f"Receiving new event of type: {chunk.event}...")
199-
print(chunk.data)
200-
print("\n\n")
201-
```
186+
```python
187+
from langgraph_sdk import get_sync_client
188+
189+
client = get_sync_client(url="http://localhost:2024")
190+
191+
for chunk in client.runs.stream(
192+
None, # Threadless run
193+
"agent", # Name of assistant. Defined in langgraph.json.
194+
input={
195+
"messages": [{
196+
"role": "human",
197+
"content": "What is LangGraph?",
198+
}],
199+
},
200+
stream_mode="messages-tuple",
201+
):
202+
print(f"Receiving new event of type: {chunk.event}...")
203+
print(chunk.data)
204+
print("\n\n")
205+
```
202206
</Tab>
203207
<Tab title="Rest API">
204208
```bash
@@ -226,9 +230,9 @@ For an Agent Server running on a custom host/port, update the baseURL parameter.
226230
<Tabs>
227231
<Tab title="Javascript SDK">
228232
1. Install the LangGraph JS SDK:
229-
```shell
230-
npm install @langchain/langgraph-sdk
231-
```
233+
```shell
234+
npm install @langchain/langgraph-sdk
235+
```
232236
2. Send a message to the assistant (threadless run):
233237
```js
234238
const { Client } = await import("@langchain/langgraph-sdk");

0 commit comments

Comments
 (0)