Documentation
¶
Overview ¶
Package channel provides shared utilities for provider adaptors. It is adapted from LingRein's pkg/relay/channel top-level package, with gin.Context dependencies removed.
Index ¶
- func DoApiRequest(ctx context.Context, a common.Adaptor, info *common.RelayInfo, ...) (*http.Response, error)
- func DoFormRequest(ctx context.Context, a common.Adaptor, info *common.RelayInfo, ...) (*http.Response, error)
- func DoTaskApiRequest(a common.TaskAdaptor, ctx context.Context, info *common.RelayInfo, ...) (*http.Response, error)
- func GetFullRequestURL(baseURL, requestURL string, channelType int) string
- func SetupApiRequestHeader(info *common.RelayInfo, header *http.Header)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoApiRequest ¶
func DoApiRequest(ctx context.Context, a common.Adaptor, info *common.RelayInfo, requestBody io.Reader) (*http.Response, error)
DoApiRequest sends an HTTP request to the upstream provider. This is the library-mode replacement for LingRein's channel.DoApiRequest.
func DoFormRequest ¶
func DoFormRequest(ctx context.Context, a common.Adaptor, info *common.RelayInfo, requestBody io.Reader) (*http.Response, error)
DoFormRequest sends a multipart form request to the upstream provider.
func DoTaskApiRequest ¶
func DoTaskApiRequest(a common.TaskAdaptor, ctx context.Context, info *common.RelayInfo, requestBody io.Reader) (*http.Response, error)
DoTaskApiRequest sends an HTTP request to the upstream provider for an async task adaptor. It is the library-mode replacement for LingRein's channel.DoTaskApiRequest.
func GetFullRequestURL ¶
GetFullRequestURL builds a full request URL from a base URL and path.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package claude provides an Anthropic Claude AI provider adaptor.
|
Package claude provides an Anthropic Claude AI provider adaptor. |
|
Package gemini provides a Google Gemini AI provider adaptor.
|
Package gemini provides a Google Gemini AI provider adaptor. |
|
Package huggingface provides a HuggingFace Inference Router adaptor.
|
Package huggingface provides a HuggingFace Inference Router adaptor. |
|
Package openai provides an OpenAI-compatible AI provider adaptor.
|
Package openai provides an OpenAI-compatible AI provider adaptor. |
Click to show internal directories.
Click to hide internal directories.