feat(llm-sdk): Responses API — MCP tools, reasoning & structured output#98
Open
ankushchhabradelta4infotech-ai wants to merge 4 commits into
Open
Conversation
…tured output Adds `respond()` method to OpenAI and Anthropic adapters and exposes `runtime.response()` so callers can use the Responses API without going through the streaming chat pipeline. - OpenAI: uses /v1/responses with MCP tool blocks, reasoning effort, and json_schema output format - Anthropic: uses Messages API with mcp-client-2025-11-20 and interleaved-thinking-2025-05-14 beta headers - Exports ResponseRequest, ResponseResult, McpServerConfig from llm-sdk root
…beta header — Claude 4.x models handle interleaved thinking automatically now via adaptive thinking
|
@ankushchhabradelta4infotech-ai is attempting to deploy a commit to the Delta4 Infotech Team on Vercel. A member of the Team first needs to authorize it. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
respond()method to thellm-sdkadapters and aruntime.response()entry point that uses the Responses API — a single-call interface supporting MCP tools, reasoning effort control, and structured output, without going through the streaming chat pipeline.Fixes #
Changes
ResponseRequest,ResponseResult, andMcpServerConfigtypes toadapters/base.tsand exported fromllm-sdkrootrespond()onOpenAIAdapterusing/v1/responseswith MCP tool blocks, reasoning effort (low | medium | high), andjson_schemastructured outputrespond()onAnthropicAdapterusing the Messages API withmcp-client-2025-11-20beta header,mcp_servers,thinking, and structured output configruntime.response()on theRuntimeclass that resolves the underlying adapter and delegates torespond()interleaved-thinking-2025-05-14Anthropic beta header — Claude 4.x handles interleaved thinking automatically via adaptive thinkingType of Change
Testing
Checklist
Screenshots (if applicable)
N/A — server-side API feature, no UI changes