mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user