feature about copilot responses api#140
Closed
caozhiyuan wants to merge 17 commits into
Closed
Conversation
…se output message type
…nd state management
…ure in translation tests
…arsing and allign with vscode-copilot-chat extractThinkingData, otherwise it will cause miss cache occasionally
…ing signature check and update prompt
…ing small model if no tools are used 2.add bun idleTimeout = 0 3.feat: Compatible with Claude code JSONL file usage error scenarios, delay closeBlockIfOpen and map responses api to anthropic support tool_use and fix spelling errors 4.feat: add configuration management with extra prompt handling and ensure config file creation
Contributor
Author
|
@ericc-ch Submitted a new PR; the feature has been in use for nearly a month without issues. |
|
This PR has been a life saver! It should be merged |
2199e26 to
5c6e4c6
Compare
c9b506d to
eeeb820
Compare
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.
This pull request introduces a new
/responsesAPI endpoint, refactors the message handling logic to support it, and adds a configuration system for model-specific prompts and defaults. The changes improve flexibility for model selection, enable advanced response streaming, and lay groundwork for future tool integrations.New
/responsesAPI endpoint/responsesendpoint with both native and streaming support, including request validation, error handling, and SSE streaming for compatible models (src/routes/responses/handler.ts,src/routes/responses/route.ts,src/server.ts,README.md). [1] [2] [3] [4] [5]Message handling and routing refactor
handleCompletionto dynamically route requests to either the legacy chat completions API or the new responses API, based on model capabilities and payload contents (src/routes/messages/handler.ts). [1] [2] [3]Configuration system and model selection
config.json) for storing extra prompts and default small model selection, with automatic file creation and access helpers (src/lib/config.ts,src/lib/paths.ts). [1] [2]src/routes/messages/handler.ts).Utility and support functions
src/routes/responses/utils.ts).Minor protocol update
signaturefield to theAnthropicThinkingBlockinterface for improved traceability (src/routes/messages/anthropic-types.ts).