mcp-use 1.7.0-canary.6 → 1.7.0-canary.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-JOG4RITX.js → chunk-VTXOGI7C.js} +1 -1
- package/dist/index.js +23 -23
- package/dist/src/agents/index.js +1 -1
- package/dist/src/browser.js +9 -9
- package/dist/src/connectors/base.d.ts +52 -8
- package/dist/src/connectors/base.d.ts.map +1 -1
- package/dist/src/react/index.js +3 -3
- package/package.json +9 -5
- package/dist/{chunk-AGKMD2ZM.js → chunk-PSO6HYXH.js} +3 -3
package/README.md
CHANGED
|
@@ -188,7 +188,7 @@ npm install ai @langchain/anthropic
|
|
|
188
188
|
|
|
189
189
|
```ts
|
|
190
190
|
import { ChatAnthropic } from '@langchain/anthropic'
|
|
191
|
-
import {
|
|
191
|
+
import { createTextStreamResponse } from 'ai'
|
|
192
192
|
import {
|
|
193
193
|
createReadableStreamFromGenerator,
|
|
194
194
|
MCPAgent,
|
|
@@ -215,7 +215,7 @@ async function createApiHandler() {
|
|
|
215
215
|
const aiSDKStream = streamEventsToAISDK(streamEvents)
|
|
216
216
|
const readableStream = createReadableStreamFromGenerator(aiSDKStream)
|
|
217
217
|
|
|
218
|
-
return
|
|
218
|
+
return createTextStreamResponse({ textStream: readableStream })
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
```
|
|
@@ -245,7 +245,7 @@ async function createEnhancedApiHandler() {
|
|
|
245
245
|
const enhancedStream = streamEventsToAISDKWithTools(streamEvents)
|
|
246
246
|
const readableStream = createReadableStreamFromGenerator(enhancedStream)
|
|
247
247
|
|
|
248
|
-
return
|
|
248
|
+
return createTextStreamResponse({ textStream: readableStream })
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
```
|
|
@@ -255,7 +255,7 @@ async function createEnhancedApiHandler() {
|
|
|
255
255
|
```ts
|
|
256
256
|
// pages/api/chat.ts or app/api/chat/route.ts
|
|
257
257
|
import { ChatAnthropic } from '@langchain/anthropic'
|
|
258
|
-
import {
|
|
258
|
+
import { createTextStreamResponse } from 'ai'
|
|
259
259
|
import {
|
|
260
260
|
createReadableStreamFromGenerator,
|
|
261
261
|
MCPAgent,
|
|
@@ -284,7 +284,7 @@ export async function POST(req: Request) {
|
|
|
284
284
|
const aiSDKStream = streamEventsToAISDK(streamEvents)
|
|
285
285
|
const readableStream = createReadableStreamFromGenerator(aiSDKStream)
|
|
286
286
|
|
|
287
|
-
return
|
|
287
|
+
return createTextStreamResponse({ textStream: readableStream })
|
|
288
288
|
} finally {
|
|
289
289
|
await client.closeAllSessions()
|
|
290
290
|
}
|