mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-15 05:35:07 +08:00
Merge branch 'dev' into codex/run-all-tests-and-fix-failures
This commit is contained in:
@@ -62,7 +62,7 @@ func (s Service) ApplyCurrentInputFile(ctx context.Context, a *auth.RequestAuth,
|
||||
stdReq.RefFileIDs = prependUniqueRefFileID(stdReq.RefFileIDs, fileID)
|
||||
stdReq.FinalPrompt, stdReq.ToolNames = promptcompat.BuildOpenAIPrompt(messages, stdReq.ToolsRaw, "", stdReq.ToolChoice, stdReq.Thinking)
|
||||
// Token accounting must reflect the actual downstream context:
|
||||
// the uploaded IGNORE.txt file content + the neutral live prompt.
|
||||
// the uploaded history.txt file content + the neutral live prompt.
|
||||
stdReq.PromptTokenText = fileText + "\n" + stdReq.FinalPrompt
|
||||
return stdReq, nil
|
||||
}
|
||||
|
||||
@@ -98,6 +98,14 @@ func NewApp() (*App, error) {
|
||||
r.Get("/v1/responses/{response_id}", responsesHandler.GetResponseByID)
|
||||
r.Post("/v1/files", filesHandler.UploadFile)
|
||||
r.Post("/v1/embeddings", embeddingsHandler.Embeddings)
|
||||
// Root OpenAI aliases support clients configured with the bare DS2API service URL.
|
||||
r.Get("/models", modelsHandler.ListModels)
|
||||
r.Get("/models/{model_id}", modelsHandler.GetModel)
|
||||
r.Post("/chat/completions", chatHandler.ChatCompletions)
|
||||
r.Post("/responses", responsesHandler.Responses)
|
||||
r.Get("/responses/{response_id}", responsesHandler.GetResponseByID)
|
||||
r.Post("/files", filesHandler.UploadFile)
|
||||
r.Post("/embeddings", embeddingsHandler.Embeddings)
|
||||
claude.RegisterRoutes(r, claudeHandler)
|
||||
gemini.RegisterRoutes(r, geminiHandler)
|
||||
r.Route("/admin", func(ar chi.Router) {
|
||||
|
||||
@@ -37,6 +37,13 @@ func TestAPIRoutesRemainRegistered(t *testing.T) {
|
||||
"GET /v1/responses/{response_id}",
|
||||
"POST /v1/files",
|
||||
"POST /v1/embeddings",
|
||||
"GET /models",
|
||||
"GET /models/{model_id}",
|
||||
"POST /chat/completions",
|
||||
"POST /responses",
|
||||
"GET /responses/{response_id}",
|
||||
"POST /files",
|
||||
"POST /embeddings",
|
||||
"GET /anthropic/v1/models",
|
||||
"POST /anthropic/v1/messages",
|
||||
"POST /anthropic/v1/messages/count_tokens",
|
||||
|
||||
Reference in New Issue
Block a user