Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAPIURL(host, endpoint string) string
- func FilterRequestBodyParams(settings map[string]interface{}, conn Connector) map[string]interface{}
- func Remove(id string) error
- func Unregister(id string) error
- type Connector
- func Load(file string, id string) (Connector, error)
- func LoadSource(source []byte, id string, file string) (Connector, error)
- func LoadSourceSync(source []byte, id string, file string) (Connector, error)
- func LoadSync(file string, id string) (Connector, error)
- func New(typ string, id string, dsl []byte) (Connector, error)
- func Select(id string) (Connector, error)
- type DSL
- type Option
Constants ¶
const ( // DATABASE the database connector (mysql, pgsql, oracle, sqlite ... ) DATABASE = iota + 1 // REDIS the redis connector REDIS // MONGO the mongodb connector MONGO // ELASTICSEARCH the elasticsearch connector ELASTICSEARCH // KAFKA the kafka connector KAFKA // OPENAI the openai connector OPENAI // WEAVIATE the weaviate connector WEAVIATE // MOAPI the moapi connector MOAPI // FASTEMBED the fastembed connector FASTEMBED // SCRIPT ? the script connector ( difference with widget ?) SCRIPT // ANTHROPIC the anthropic connector (Claude API format) ANTHROPIC // TYPESAFE the TypeSafe AI (Jev decision) connector TYPESAFE )
Variables ¶
var AIConnectors = []Option{}
AIConnectors the AI connectors
var Connectors = map[string]Connector{}
Connectors the loaded connectors
Functions ¶
func BuildAPIURL ¶ added in v1.0.0
BuildAPIURL builds the complete API URL from host and endpoint.
If host ends with "/" it is used as-is (the user has specified a full base path such as "https://my-proxy.example.com/v1/"). Otherwise a "/v1" prefix is prepended to the endpoint automatically, which is the standard convention for OpenAI-compatible APIs (e.g. host="https://api.openai.com", endpoint="/chat/completions"
→ "https://api.openai.com/v1/chat/completions").
This is the single source of truth so that every caller (agent LLM provider, sandbox proxy, graphrag utilities, …) builds URLs the same way.
func FilterRequestBodyParams ¶ added in v1.0.0
func FilterRequestBodyParams(settings map[string]interface{}, conn Connector) map[string]interface{}
FilterRequestBodyParams filters Setting() output to only keep parameters that belong in an API request body, applying value constraints when available.
Priority:
- conn implements llm.LLMConnector with non-nil GetSupportedParams() → strict whitelist + clamp
- conn type matches a known provider → provider-type default set
- neither → strip known metadata keys, pass through the rest
func Unregister ¶ added in v1.0.0
Unregister closes and fully removes a connector from Connectors map and AIConnectors slice. Safe for concurrent use.
Types ¶
type Connector ¶
type Connector interface {
Register(file string, id string, dsl []byte) error
Query() (query.Query, error)
Schema() (schema.Schema, error)
Close() error
ID() string
Is(int) bool
Setting() map[string]interface{}
GetMetaInfo() gouTypes.MetaInfo
GetMetadata() map[string]interface{}
}
Connector the connector interface
func LoadSource ¶ added in v1.0.0
LoadSource load a connector from source
func LoadSourceSync ¶ added in v1.0.0
LoadSourceSync load connector sync
type DSL ¶
type DSL struct {
gouTypes.MetaInfo
gouTypes.ConnectorMetadata
ID string `json:"-"`
Type string `json:"type"`
Name string `json:"name,omitempty"`
// Label string `json:"label,omitempty"`
Version string `json:"version,omitempty"`
Options map[string]interface{} `json:"options,omitempty"`
}
DSL the connector DSL