agent

package
v0.0.0-...-557c218 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TwitterClientModeEnv   = "env"
	TwitterClientModeApi   = "api"
	TwitterClientModeProxy = "proxy"
)
View Source
const (
	XClientModeKey            = "X_CLIENT_MODE"
	AgentTwitterClientPortKey = "AGENT_TWITTER_CLIENT_PORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(config *AgentConfig) (*Agent, error)

func (*Agent) ProcessEvents

func (a *Agent) ProcessEvents(ctx context.Context) error

func (*Agent) ProcessPromptPaidEvent

func (a *Agent) ProcessPromptPaidEvent(ctx context.Context, agentAddress *felt.Felt, promptPaidEvent *indexer.PromptPaidEvent, block uint64) error

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

func (*Agent) StartServer

func (a *Agent) StartServer(ctx context.Context) error

type AgentAccountDeploymentState

type AgentAccountDeploymentState struct {
	AlreadyDeployed  bool
	DeploymentErr    error
	DeployedAt       int64
	Balance          *big.Int
	BalanceUpdatedAt int64
	Waiting          bool
}

type AgentConfig

type AgentConfig struct {
	TwitterClient       twitter.TwitterClient
	TwitterClientConfig *twitter.TwitterClientConfig

	IsUnencumbered bool
	UnencumberData *setup.UnencumberData

	ChatCompletion chat.ChatCompletion
	StarknetClient starknet.ProviderWrapper
	Quoter         quote.Quoter

	AgentIndexer *indexer.AgentIndexer
	EventWatcher *indexer.EventWatcher
	NameCache    *validation.NameCache

	Account                *snaccount.StarknetAccount
	AccountDeploymentState AgentAccountDeploymentState
	TxQueue                *snaccount.TxQueue

	Pool pond.Pool

	StartupBlockNumber   uint64
	AgentRegistryAddress *felt.Felt
	AgentRegistryBlock   uint64

	PromptIndexerEndpoint string
	PromptIndexerApiKey   string
	// contains filtered or unexported fields
}

func NewAgentConfigFromParams

func NewAgentConfigFromParams(params *AgentConfigParams) (*AgentConfig, error)

type AgentConfigParams

type AgentConfigParams struct {
	TwitterClientMode            string
	TwitterClientConfig          *twitter.TwitterClientConfig
	IsUnencumbered               bool
	UnencumberData               *setup.UnencumberData
	OpenAIKey                    string
	DstackTappdEndpoint          string
	StarknetRpcUrls              []string
	StarknetPrivateKeySeed       []byte
	AgentRegistryAddress         *felt.Felt
	AgentRegistryDeploymentBlock uint64
	TaskConcurrency              int
	TickRate                     time.Duration
	SafeBlockDelta               uint64
	MaxSystemPromptTokens        int
	MaxPromptTokens              int
	PromptIndexerEndpoint        string
	PromptIndexerApiKey          string
}

type QuoteData

type QuoteData struct {
	Quote      string
	ReportData *quote.ReportData
}

Directories

Path Synopsis
encumber
proton
Proton encumberance utilities Initially based on https://github.com/tee-he-he/err_err_ttyl/blob/a3f296a5caaf7f23afa20c8841da39fe18a275bd/scripts/protonmail.py
Proton encumberance utilities Initially based on https://github.com/tee-he-he/err_err_ttyl/blob/a3f296a5caaf7f23afa20c8841da39fe18a275bd/scripts/protonmail.py
twitter
Twitter encumberance utilities Initially based on https://github.com/tee-he-he/err_err_ttyl/blob/a3f296a5caaf7f23afa20c8841da39fe18a275bd/scripts/twitter.py
Twitter encumberance utilities Initially based on https://github.com/tee-he-he/err_err_ttyl/blob/a3f296a5caaf7f23afa20c8841da39fe18a275bd/scripts/twitter.py

Jump to

Keyboard shortcuts

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