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

@@ -30,10 +30,18 @@ import (
infinity "github.com/infiniflow/infinity-go-sdk"
)
// infinityClient Infinity SDK client wrapper
type infinityClient struct {
conn *infinity.InfinityConnection
dbName string
// Original URI from config, used by RunSQL to extract the host.
hostURI string
// Port for psql wire-protocol listener (default 5432).
postgresPort int
// JSON file (under conf/) with the field-name alias map.
mappingFileName string
}
// NewInfinityClient creates a new Infinity client using the SDK
@@ -70,8 +78,11 @@ func NewInfinityClient(cfg *server.InfinityConfig) (*infinityClient, error) {
}
client := &infinityClient{
conn: conn,
dbName: cfg.DBName,
conn: conn,
dbName: cfg.DBName,
hostURI: cfg.URI,
postgresPort: cfg.PostgresPort,
mappingFileName: cfg.MappingFileName,
}
return client, nil