Documentation
¶
Index ¶
- func FormatBasicAuthHeader(login, pass string) string
- func StringTo32Byte(s string) [32]byte
- type ApiGatewayClient
- func (c *ApiGatewayClient) ApproveAllowance(ctx context.Context, spender string, amount uint64) (map[string]interface{}, error)
- func (c *ApiGatewayClient) CloseSession(ctx context.Context, sessionId string) error
- func (c *ApiGatewayClient) CreateNewModel(ctx context.Context, name string, ipfsID string, stake uint64, fee uint64, ...) (result map[string]interface{}, err error)
- func (c *ApiGatewayClient) CreateNewProvider(ctx context.Context, addStake uint64, endpoint string) (result interface{}, err error)
- func (c *ApiGatewayClient) CreateNewProviderBid(ctx context.Context, model string, pricePerSecond uint64) (result map[string]interface{}, err error)
- func (c *ApiGatewayClient) CreateWallet(ctx context.Context, privateKey string) error
- func (c *ApiGatewayClient) GetAllModels(ctx context.Context) (result map[string]interface{}, err error)
- func (c *ApiGatewayClient) GetAllProviders(ctx context.Context) (result map[string]interface{}, err error)
- func (c *ApiGatewayClient) GetAllowance(ctx context.Context, spender string) (map[string]interface{}, error)
- func (c *ApiGatewayClient) GetAuthHeaderValue() string
- func (c *ApiGatewayClient) GetBalance(ctx context.Context) (eth string, mor string, err error)
- func (c *ApiGatewayClient) GetBidsByModelAgent(ctx context.Context, modelAgentId string, offset string, limit string) (result map[string]interface{}, err error)
- func (c *ApiGatewayClient) GetBidsByProvider(ctx context.Context, providerAddr string, offset *big.Int, limit uint8) (bids interface{}, err error)
- func (c *ApiGatewayClient) GetCookiePath(ctx context.Context) (string, error)
- func (c *ApiGatewayClient) GetDiamondAddress(ctx context.Context) (common.Address, error)
- func (c *ApiGatewayClient) GetLatestBlock(ctx context.Context) (result uint64, err error)
- func (c *ApiGatewayClient) GetLocalModels(ctx context.Context) (models *[]interface{}, err error)
- func (c *ApiGatewayClient) GetProxyRouterConfig(ctx context.Context) (interface{}, error)
- func (c *ApiGatewayClient) GetProxyRouterFiles(ctx context.Context) (interface{}, error)
- func (c *ApiGatewayClient) GetWallet(ctx context.Context) (*WalletResponse, error)
- func (c *ApiGatewayClient) HealthCheck(ctx context.Context) (interface{}, error)
- func (c *ApiGatewayClient) InitiateSession(ctx context.Context) (interface{}, error)
- func (c *ApiGatewayClient) ListProviderSessions(ctx context.Context, provider string) (result []SessionListItem, err error)
- func (c *ApiGatewayClient) ListUserSessions(ctx context.Context, user string) (result []SessionListItem, err error)
- func (c *ApiGatewayClient) OpenSession(ctx context.Context, req *SessionRequest) (session *Session, err error)
- func (c *ApiGatewayClient) OpenStakeSession(ctx context.Context, req *SessionStakeRequest) (session *Session, err error)
- func (c *ApiGatewayClient) PromptStream(ctx context.Context, message string, ...) (interface{}, error)
- func (c *ApiGatewayClient) SetAuth(login, pass string)
- type ChatCompletionMessage
- type ChatCompletionRequest
- type ChatCompletionStreamChoice
- type ChatCompletionStreamChoiceDelta
- type ChatCompletionStreamResponse
- type CloseSessionRequest
- type CompletionCallback
- type GetEnvFunc
- type Session
- type SessionListItem
- type SessionRequest
- type SessionStakeRequest
- type WalletRequest
- type WalletResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBasicAuthHeader ¶
func StringTo32Byte ¶
Types ¶
type ApiGatewayClient ¶
type ApiGatewayClient struct {
BaseURL string
HttpClient *http.Client
// contains filtered or unexported fields
}
func NewApiGatewayClient ¶
func NewApiGatewayClient(baseURL string, httpClient *http.Client) *ApiGatewayClient
func NewApiGatewayClientFromEnv ¶
func NewApiGatewayClientFromEnv(getEnv GetEnvFunc) (*ApiGatewayClient, error)
func (*ApiGatewayClient) ApproveAllowance ¶
func (*ApiGatewayClient) CloseSession ¶
func (c *ApiGatewayClient) CloseSession(ctx context.Context, sessionId string) error
func (*ApiGatewayClient) CreateNewModel ¶
func (*ApiGatewayClient) CreateNewProvider ¶
func (*ApiGatewayClient) CreateNewProviderBid ¶
func (*ApiGatewayClient) CreateWallet ¶
func (c *ApiGatewayClient) CreateWallet(ctx context.Context, privateKey string) error
func (*ApiGatewayClient) GetAllModels ¶
func (c *ApiGatewayClient) GetAllModels(ctx context.Context) (result map[string]interface{}, err error)
func (*ApiGatewayClient) GetAllProviders ¶
func (c *ApiGatewayClient) GetAllProviders(ctx context.Context) (result map[string]interface{}, err error)
func (*ApiGatewayClient) GetAllowance ¶
func (*ApiGatewayClient) GetAuthHeaderValue ¶
func (c *ApiGatewayClient) GetAuthHeaderValue() string
func (*ApiGatewayClient) GetBalance ¶
func (*ApiGatewayClient) GetBidsByModelAgent ¶
func (*ApiGatewayClient) GetBidsByProvider ¶
func (*ApiGatewayClient) GetCookiePath ¶
func (c *ApiGatewayClient) GetCookiePath(ctx context.Context) (string, error)
func (*ApiGatewayClient) GetDiamondAddress ¶
func (*ApiGatewayClient) GetLatestBlock ¶
func (c *ApiGatewayClient) GetLatestBlock(ctx context.Context) (result uint64, err error)
func (*ApiGatewayClient) GetLocalModels ¶
func (c *ApiGatewayClient) GetLocalModels(ctx context.Context) (models *[]interface{}, err error)
func (*ApiGatewayClient) GetProxyRouterConfig ¶
func (c *ApiGatewayClient) GetProxyRouterConfig(ctx context.Context) (interface{}, error)
func (*ApiGatewayClient) GetProxyRouterFiles ¶
func (c *ApiGatewayClient) GetProxyRouterFiles(ctx context.Context) (interface{}, error)
func (*ApiGatewayClient) GetWallet ¶
func (c *ApiGatewayClient) GetWallet(ctx context.Context) (*WalletResponse, error)
func (*ApiGatewayClient) HealthCheck ¶
func (c *ApiGatewayClient) HealthCheck(ctx context.Context) (interface{}, error)
func (*ApiGatewayClient) InitiateSession ¶
func (c *ApiGatewayClient) InitiateSession(ctx context.Context) (interface{}, error)
func (*ApiGatewayClient) ListProviderSessions ¶
func (c *ApiGatewayClient) ListProviderSessions(ctx context.Context, provider string) (result []SessionListItem, err error)
func (*ApiGatewayClient) ListUserSessions ¶
func (c *ApiGatewayClient) ListUserSessions(ctx context.Context, user string) (result []SessionListItem, err error)
func (*ApiGatewayClient) OpenSession ¶
func (c *ApiGatewayClient) OpenSession(ctx context.Context, req *SessionRequest) (session *Session, err error)
func (*ApiGatewayClient) OpenStakeSession ¶
func (c *ApiGatewayClient) OpenStakeSession(ctx context.Context, req *SessionStakeRequest) (session *Session, err error)
func (*ApiGatewayClient) PromptStream ¶
func (c *ApiGatewayClient) PromptStream(ctx context.Context, message string, messagesContext []openai.ChatCompletionMessage, modelId string, sessionId string, flush CompletionCallback) (interface{}, error)
func (*ApiGatewayClient) SetAuth ¶
func (c *ApiGatewayClient) SetAuth(login, pass string)
type ChatCompletionMessage ¶
type ChatCompletionMessage = openai.ChatCompletionMessage
type ChatCompletionRequest ¶
type ChatCompletionRequest = openai.ChatCompletionRequest
type ChatCompletionStreamChoice ¶
type ChatCompletionStreamChoice = openai.ChatCompletionStreamChoice
type ChatCompletionStreamChoiceDelta ¶
type ChatCompletionStreamChoiceDelta = openai.ChatCompletionStreamChoiceDelta
type ChatCompletionStreamResponse ¶
type ChatCompletionStreamResponse = openai.ChatCompletionStreamResponse
type CloseSessionRequest ¶
type CloseSessionRequest struct {
SessionId string `json:"id" validate:"required"`
}
type CompletionCallback ¶
type CompletionCallback = func(completion interface{}) error
type GetEnvFunc ¶
type SessionListItem ¶
type SessionListItem struct {
Bid string `json:"BidID"`
Session string `json:"Id"`
ModelORAgent string `json:"ModelAgentId"`
PricePerSecond uint64 `json:"PricePerSecond"`
Provider string `json:"Provider"`
User string `json:"User"`
ClosedAt uint64 `json:"ClosedAt"`
CloseoutReceipt string `json:"CloseoutReceipt"`
CloseoutType uint `json:"CloseoutType"`
EndsAt uint64 `json:"EndsAt"`
}
type SessionRequest ¶
type SessionStakeRequest ¶
type WalletRequest ¶
type WalletRequest struct {
PrivateKey string `json:"privateKey" validate:"required"`
}
type WalletResponse ¶
type WalletResponse struct {
Address string `json:"address"`
}
Click to show internal directories.
Click to hide internal directories.