types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Key       string      `json:"key"`
	TestModel []string    `json:"test_model"`
	URL       string      `json:"url"`
	Type      ChannelType `json:"type"`
}

type ChannelType

type ChannelType int
const (
	ChannelTypeGemini ChannelType = iota
	ChannelTypeOpenAI
)

type ChatMessage

type ChatMessage struct {
	Role    string          `json:"role"`
	Content json.RawMessage `json:"content"`
}

type Message

type Message struct {
	Type     MessageType
	Content  string
	Headers  *RequestHeaders
	Error    error
	Request  string
	Response string
}

type MessageType

type MessageType int
const (
	MessageTypeNode MessageType = iota
	MessageTypeError
	MessageTypeAPI
	MessageTypeRequest
)

type Node

type Node struct {
	IP           string
	Country      string
	Time         time.Time
	UserAgent    string
	RequestInfo  string
	ForwardedFor string
	RequestCount int // Track number of requests for this node
	IsNew        bool
	NodeIndex    int
	RegionName   string
	Org          string
	ServerName   string
}

type RequestHeaders

type RequestHeaders struct {
	UserAgent    string
	ForwardedFor string
	Time         time.Time
	IP           string
}

type TestResult

type TestResult struct {
	Key      string
	Model    string
	Success  bool
	Latency  float64
	ErrorMsg string
}

type Usage

type Usage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

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