Skip to content

feat(llm-sdk): Responses API — MCP tools, reasoning & structured output#98

Open
ankushchhabradelta4infotech-ai wants to merge 4 commits into
YourGPT:betafrom
ankushchhabradelta4infotech-ai:feat/responses-api
Open

feat(llm-sdk): Responses API — MCP tools, reasoning & structured output#98
ankushchhabradelta4infotech-ai wants to merge 4 commits into
YourGPT:betafrom
ankushchhabradelta4infotech-ai:feat/responses-api

Conversation

@ankushchhabradelta4infotech-ai

Copy link
Copy Markdown
Contributor

Description

Adds a respond() method to the llm-sdk adapters and a runtime.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

  • Added ResponseRequest, ResponseResult, and McpServerConfig types to adapters/base.ts and exported from llm-sdk root
  • Implemented respond() on OpenAIAdapter using /v1/responses with MCP tool blocks, reasoning effort (low | medium | high), and json_schema structured output
  • Implemented respond() on AnthropicAdapter using the Messages API with mcp-client-2025-11-20 beta header, mcp_servers, thinking, and structured output config
  • Exposed runtime.response() on the Runtime class that resolves the underlying adapter and delegates to respond()
  • Removed deprecated interleaved-thinking-2025-05-14 Anthropic beta header — Claude 4.x handles interleaved thinking automatically via adaptive thinking

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Testing

  • I've tested this locally
  • I've added/updated tests
  • All existing tests pass

Checklist

  • My code follows the project's style guidelines
  • I've updated the documentation (if needed)
  • New and existing tests pass locally

Screenshots (if applicable)

N/A — server-side API feature, no UI changes

…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
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant