Skip to content

Commit 9943196

Browse files
committed
chore: update elicitation/sampling streaming for v2
1 parent 01f864b commit 9943196

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/client/src/simpleStreamableHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
ErrorCode,
1717
getDisplayName,
1818
GetPromptResultSchema,
19+
InMemoryTaskStore,
1920
ListPromptsResultSchema,
2021
ListResourcesResultSchema,
2122
ListToolsResultSchema,
@@ -27,7 +28,6 @@ import {
2728
StreamableHTTPClientTransport
2829
} from '@modelcontextprotocol/client';
2930
import { Ajv } from 'ajv';
30-
import { InMemoryTaskStore } from '../../experimental/tasks/stores/in-memory.js';
3131

3232
// Create readline interface for user input
3333
const readline = createInterface({

packages/server/src/experimental/tasks/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class ExperimentalServerTasks<
140140
// These may appear even without tools/toolChoice in the current request when
141141
// a previous sampling request returned tool_use and this is a follow-up with results.
142142
if (params.messages.length > 0) {
143-
const lastMessage = params.messages[params.messages.length - 1];
143+
const lastMessage = params.messages[params.messages.length - 1]!;
144144
const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
145145
const hasToolResults = lastContent.some(c => c.type === 'tool_result');
146146

0 commit comments

Comments
 (0)