ai

package
v0.0.0-...-79e88c3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAgents

func GenerateAgents(topic string) (string, error)

func GenerateLLMResponse

func GenerateLLMResponse(prompt string) string

GenerateLLMResponse generates a response using OpenAI's GPT model

func GenerateLLMResponseWithResearch

func GenerateLLMResponseWithResearch(prompt string, topic string, traits []string) string

GenerateLLMResponseWithResearch generates a response using OpenAI's GPT model with web research capability

func GenerateMeme

func GenerateMeme(block core.Block, decision string) string

GenerateMeme generates a meme response for block validation

func InitAI

func InitAI()

Types

type Discussion

type Discussion struct {
	ID            string    `json:"id"` // Unique identifier for the discussion
	ValidatorID   string    `json:"validatorId"`
	ValidatorName string    `json:"validatorName"`
	Message       string    `json:"message"`
	Support       bool      `json:"support"`
	Oppose        bool      `json:"oppose"`
	Question      bool      `json:"question"`
	Timestamp     time.Time `json:"timestamp"`
	Round         int       `json:"round"` // Which discussion round (1-5)
}

func GetValidatorDiscussion

func GetValidatorDiscussion(agent core.Agent, tx core.Transaction) Discussion

type LLMConfig

type LLMConfig struct {
	Model       string
	MaxTokens   int
	Temperature float32
	StopTokens  []string
}

LLMConfig holds configuration for LLM interactions

func DefaultLLMConfig

func DefaultLLMConfig() LLMConfig

DefaultLLMConfig returns standard LLM configuration

type LoanReview

type LoanReview struct {
	Summary     string   `json:"summary"`
	RiskFactors []string `json:"risk_factors"`
	Terms       []string `json:"terms"`
	Approval    bool     `json:"approval"`
}

func GetLoanReview

func GetLoanReview(agent core.Agent, loan string, previousDiscussion string) LoanReview

func GetMultiRoundLoanReview

func GetMultiRoundLoanReview(agent core.Agent, loan string, chainID string) LoanReview

type PaperReview

type PaperReview struct {
	Summary        string   `json:"summary"`
	Flaws          []string `json:"flaws"`
	Suggestions    []string `json:"suggestions"`
	IsReproducible bool     `json:"is_reproducible"`
	Approval       bool     `json:"approval"`
}

func GetMultiRoundReview

func GetMultiRoundReview(agent core.Agent, paper ResearchPaper, chainID string) PaperReview

func GetPaperReview

func GetPaperReview(agent core.Agent, paper ResearchPaper, previousDiscussion string) PaperReview

type Personality

type Personality struct {
	Name            string
	Traits          []string
	Style           string
	MemePreferences []string
	APIKey          string // OpenAI API Key for AI-powered decision making
}

Personality represents an AI producer's unique identity

func (*Personality) GenerateBlockAnnouncement

func (p *Personality) GenerateBlockAnnouncement(block core.Block) string

GenerateBlockAnnouncement creates a chaotic message for block propagation

func (*Personality) SelectTransactions

func (p *Personality) SelectTransactions(txs []core.Transaction) []core.Transaction

SelectTransactions uses AI to choose transactions based on chaos & personality

func (*Personality) SignBlock

func (p *Personality) SignBlock(block core.Block) string

SignBlock generates a cryptographic hash signature for a block

type ResearchDecision

type ResearchDecision struct {
	NeedsResearch bool     `json:"needs_research"`
	SearchQueries []string `json:"search_queries"`
	Reasoning     string   `json:"reasoning"`
}

ResearchDecision represents the LLM's decision about web research

type ResearchPaper

type ResearchPaper struct {
	Title     string   `json:"title"`
	Abstract  string   `json:"abstract"`
	Content   string   `json:"content"`
	Author    string   `json:"author"`
	TopicTags []string `json:"topic_tags"`
	Timestamp int64    `json:"timestamp"`
}

type SearchConfig

type SearchConfig struct {
	MaxResults int
	SafeSearch bool
}

SearchConfig holds configuration for web search

func DefaultSearchConfig

func DefaultSearchConfig() SearchConfig

DefaultSearchConfig returns standard search configuration

type SearchResult

type SearchResult struct {
	Title   string `json:"title"`
	Snippet string `json:"snippet"`
	Link    string `json:"link"`
}

SearchResult represents a web search result

Jump to

Keyboard shortcuts

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