Implement OpenAI chat completions in GO (#16177)

### What problem does this PR solve?

Implement OpenAI chat completions in GO

POST /api/v1/openai/<chat_id>/chat/completions

OpenAI chat cli: internal/development.md

### Type of change

- [x] Refactoring
This commit is contained in:
qinling0210
2026-06-18 18:07:27 +08:00
committed by GitHub
parent b53b5bf12c
commit 563d855780
61 changed files with 15327 additions and 2105 deletions
+7 -1
View File
@@ -49,7 +49,7 @@ var operatorMapping = map[string]string{
">=": "≥",
"<=": "≤",
"!=": "≠",
"==": "=",
"==": "=",
}
// ParseAndConvert converts raw API conditions into MetaFilterInput.
@@ -76,10 +76,16 @@ func ParseAndConvert(metadataCondition map[string]interface{}) *MetaFilterInput
continue
}
name, _ := cond["name"].(string)
if name == "" {
name, _ = cond["key"].(string) // OpenAI API metadata_condition uses "key"
}
if name == "" {
continue
}
op, _ := cond["comparison_operator"].(string)
if op == "" {
op, _ = cond["operator"].(string) // OpenAI API uses "operator"
}
op = convertOperator(op)
conditions = append(conditions, MetaCondition{
Operator: op,