Documentation
¶
Index ¶
- Constants
- type Proxy
- func (p *Proxy) Close() error
- func (p *Proxy) Endpoint() *target.Endpoint
- func (p *Proxy) ID() string
- func (p *Proxy) LLMAdapter() (ai.LLMAdapter, error)
- func (p *Proxy) ServeHTTP(ctx context.Context, hzCtx *app.RequestContext)
- func (p *Proxy) SetEndpoint(ep *target.Endpoint)
- func (p *Proxy) Target() string
- type ProxyOptions
Constants ¶
View Source
const ( // TargetPartsCount is the expected number of parts when splitting target (provider/model). TargetPartsCount = 2 // StreamReadBufferSize is the buffer size for reading SSE streams. StreamReadBufferSize = 4096 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy implements proxy.Proxy for LLM upstream connections.
func NewProxy ¶
func NewProxy(opts ProxyOptions) (*Proxy, error)
NewProxy creates a new AIProxy instance.
func (*Proxy) LLMAdapter ¶
func (p *Proxy) LLMAdapter() (ai.LLMAdapter, error)
LLMAdapter returns the initialized LLMAdapter for the proxy.
func (*Proxy) ServeHTTP ¶
func (p *Proxy) ServeHTTP(ctx context.Context, hzCtx *app.RequestContext)
ServeHTTP handles incoming HTTP requests and proxies them to the target LLM provider.
func (*Proxy) SetEndpoint ¶
SetEndpoint updates the endpoint info associated with this proxy.
Click to show internal directories.
Click to hide internal directories.