mirror of
https://github.com/alibaba/higress.git
synced 2026-06-04 18:17:33 +08:00
Support Openai structure output api (#feat 1214) (#1217)
Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
@@ -89,6 +89,10 @@ func (m *openaiProvider) OnRequestBody(ctx wrapper.HttpContext, apiName ApiName,
|
||||
if err := decodeChatCompletionRequest(body, request); err != nil {
|
||||
return types.ActionContinue, err
|
||||
}
|
||||
if m.config.responseJsonSchema != nil {
|
||||
log.Debugf("[ai-proxy] set response format to %s", m.config.responseJsonSchema)
|
||||
request.ResponseFormat = m.config.responseJsonSchema
|
||||
}
|
||||
if request.Stream {
|
||||
// For stream requests, we need to include usage in the response.
|
||||
if request.StreamOptions == nil {
|
||||
|
||||
Reference in New Issue
Block a user