Documentation
¶
Index ¶
- type AgentData
- type AgentDataPrompt
- type AgentPageResponse
- type GetUsageResponse
- type GetUsageResponseAttempts
- type GetUsageResponsePrizePools
- type PromptData
- type PromptPageResponse
- type RegisterPromptResponseRequest
- type UIService
- func (s *UIService) HandleGetAgent(c *gin.Context)
- func (s *UIService) HandleGetLeaderboard(c *gin.Context)
- func (s *UIService) HandleGetPromptResponse(c *gin.Context)
- func (s *UIService) HandleGetUsage(c *gin.Context)
- func (s *UIService) HandleGetUserAgents(c *gin.Context)
- func (s *UIService) HandleGetUserLeaderboard(c *gin.Context)
- func (s *UIService) HandleGetUserPrompts(c *gin.Context)
- func (s *UIService) HandleRegisterPromptResponse(c *gin.Context)
- func (s *UIService) HandleSearchAgents(c *gin.Context)
- func (s *UIService) Run(ctx context.Context) error
- type UIServiceConfig
- type UserData
- type UserPageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentData ¶
type AgentData struct {
Pending bool `json:"pending"`
Address string `json:"address"`
Creator string `json:"creator"`
Token string `json:"token"`
Name string `json:"name"`
SystemPrompt string `json:"system_prompt"`
PromptPrice string `json:"prompt_price"`
Balance string `json:"balance"`
EndTime string `json:"end_time"`
Model string `json:"model"`
IsDrained bool `json:"is_drained"`
DrainAmount string `json:"drain_amount"`
IsFinalized bool `json:"is_finalized"`
IsWithdrawn bool `json:"is_withdrawn"`
BreakAttempts string `json:"break_attempts"`
LatestPrompts []*AgentDataPrompt `json:"latest_prompts"`
DrainPrompt *AgentDataPrompt `json:"drain_prompt"`
}
type AgentDataPrompt ¶
type AgentPageResponse ¶
type GetUsageResponse ¶
type GetUsageResponse struct {
RegisteredAgents uint64 `json:"registered_agents"`
Attempts *GetUsageResponseAttempts `json:"attempts"`
PrizePools GetUsageResponsePrizePools `json:"prize_pools"`
}
type PromptData ¶
type PromptData struct {
Pending bool `json:"pending"`
PromptID string `json:"prompt_id"`
AgentAddr string `json:"agent_addr"`
IsDrain bool `json:"is_drain"`
Prompt string `json:"prompt"`
Response string `json:"response,omitempty"`
Error string `json:"error,omitempty"`
BlockNumber string `json:"block_number"`
UserAddr string `json:"user_addr"`
}
type PromptPageResponse ¶
type PromptPageResponse struct {
Prompts []*PromptData `json:"prompts"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
LastBlock int `json:"last_block"`
}
type RegisterPromptResponseRequest ¶
type RegisterPromptResponseRequest struct {
PromptID *uint64 `json:"prompt_id" binding:"required"`
AgentAddr *string `json:"agent_addr" binding:"required"`
Price *string `json:"price" binding:"required"`
IsDrain *bool `json:"is_drain" binding:"required"`
Prompt *string `json:"prompt" binding:"required"`
Response *string `json:"response"`
Error *string `json:"error"`
BlockNumber *uint64 `json:"block_number" binding:"required"`
UserAddr *string `json:"user_addr" binding:"required"`
}
RegisterPromptResponseRequest represents the request body for registering a prompt response
type UIService ¶
type UIService struct {
// contains filtered or unexported fields
}
func NewUIService ¶
func NewUIService(config *UIServiceConfig) (*UIService, error)
func (*UIService) HandleGetAgent ¶
func (*UIService) HandleGetLeaderboard ¶
func (*UIService) HandleGetPromptResponse ¶
func (*UIService) HandleGetUsage ¶
func (*UIService) HandleGetUserAgents ¶
func (*UIService) HandleGetUserLeaderboard ¶
func (*UIService) HandleGetUserPrompts ¶
func (*UIService) HandleRegisterPromptResponse ¶
func (*UIService) HandleSearchAgents ¶
type UIServiceConfig ¶
type UIServiceConfig struct {
Client starknet.ProviderWrapper
MaxPageSize int
ServerAddr string
RegistryAddress *felt.Felt
StartingBlock uint64
TokenRates map[[32]byte]*big.Int
PriceTickRate time.Duration
EventTickRate time.Duration
EventStartupTickRate time.Duration
UserTickRate time.Duration
AgentBalanceTickRate time.Duration
PromptIndexerDBPath string
PromptIndexerApiKey string
}
Click to show internal directories.
Click to hide internal directories.