client

package
v0.0.0-...-9f23b6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBasicAuthHeader

func FormatBasicAuthHeader(login, pass string) string

func StringTo32Byte

func StringTo32Byte(s string) [32]byte

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 (c *ApiGatewayClient) ApproveAllowance(ctx context.Context, spender string, amount uint64) (map[string]interface{}, error)

func (*ApiGatewayClient) CloseSession

func (c *ApiGatewayClient) CloseSession(ctx context.Context, sessionId string) error

func (*ApiGatewayClient) CreateNewModel

func (c *ApiGatewayClient) CreateNewModel(ctx context.Context, name string, ipfsID string, stake uint64, fee uint64, tags []string) (result map[string]interface{}, err error)

func (*ApiGatewayClient) CreateNewProvider

func (c *ApiGatewayClient) CreateNewProvider(ctx context.Context, addStake uint64, endpoint string) (result interface{}, err error)

func (*ApiGatewayClient) CreateNewProviderBid

func (c *ApiGatewayClient) CreateNewProviderBid(ctx context.Context, model string, pricePerSecond uint64) (result map[string]interface{}, err error)

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 (c *ApiGatewayClient) GetAllowance(ctx context.Context, spender string) (map[string]interface{}, error)

func (*ApiGatewayClient) GetAuthHeaderValue

func (c *ApiGatewayClient) GetAuthHeaderValue() string

func (*ApiGatewayClient) GetBalance

func (c *ApiGatewayClient) GetBalance(ctx context.Context) (eth string, mor string, err error)

func (*ApiGatewayClient) GetBidsByModelAgent

func (c *ApiGatewayClient) GetBidsByModelAgent(ctx context.Context, modelAgentId string, offset string, limit string) (result map[string]interface{}, err error)

func (*ApiGatewayClient) GetBidsByProvider

func (c *ApiGatewayClient) GetBidsByProvider(ctx context.Context, providerAddr string, offset *big.Int, limit uint8) (bids interface{}, err error)

func (*ApiGatewayClient) GetCookiePath

func (c *ApiGatewayClient) GetCookiePath(ctx context.Context) (string, error)

func (*ApiGatewayClient) GetDiamondAddress

func (c *ApiGatewayClient) GetDiamondAddress(ctx context.Context) (common.Address, error)

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 GetEnvFunc func(key string) string

type Session

type Session struct {
	SessionId string `json:"sessionID"`
}

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 SessionRequest struct {
	ModelId         string   `json:"modelId" validate:"required"`
	SessionDuration *big.Int `json:"sessionDuration" validate:"required"`
}

type SessionStakeRequest

type SessionStakeRequest struct {
	Approval    string `json:"approval" validate:"required"`
	ApprovalSig string `json:"approvalSig" validate:"required"`
	Stake       uint64 `json:"stake" validate:"required,number"`
}

type WalletRequest

type WalletRequest struct {
	PrivateKey string `json:"privateKey" validate:"required"`
}

type WalletResponse

type WalletResponse struct {
	Address string `json:"address"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL