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

View File

@@ -61,6 +61,10 @@ type DocEngine interface {
GetFields(chunks []map[string]interface{}, fields []string) map[string]map[string]interface{}
GetAggregation(chunks []map[string]interface{}, fieldName string) []map[string]interface{}
GetHighlight(chunks []map[string]interface{}, keywords []string, fieldName string) map[string]string
// Run SQL
RunSQL(ctx context.Context, tableName string, sqlText string, kbIDs []string, format string) ([]map[string]interface{}, error)
GetChunkIDs(chunks []map[string]interface{}) []string
KNNScores(ctx context.Context, chunks []map[string]interface{}, queryVector []float64, topK int) (map[string]interface{}, error)
GetScores(searchResult map[string]interface{}) map[string]float64