Documentation
¶
Index ¶
- func CalcDeviation(counts map[int]map[model.Role]int, theoretical map[model.Role]float64) float64
- func CalcHasErrorAgents(agents []*model.Agent) int
- func CalcTheoretical(roleNumMap map[model.Role]int, gameCount int, teamCount int) (map[model.Role]float64, []model.Role)
- func CalcWinSideTeam(statusMap map[model.Agent]model.Status) model.Team
- func ConvertWavToSegment(params ConvertWavToSegmentParams) ([]string, error)
- func CountAliveTeams(statusMap map[model.Agent]model.Status) (int, int)
- func CountLength(text string, inWord bool, countSpaces bool) int
- func CreateAgents(conns []model.Connection, roles map[model.Role]int) []*model.Agent
- func CreateAgentsWithProfiles(conns []model.Connection, roles map[model.Role]int, profiles []model.Profile, ...) []*model.Agent
- func CreateAgentsWithRole(roleMapConns map[model.Role][]model.Connection) []*model.Agent
- func CreateAgentsWithRoleAndProfile(roleMapConns map[model.Role][]model.Connection, profiles []model.Profile, ...) []*model.Agent
- func FilterAgents(agents []*model.Agent, filter func(*model.Agent) bool) []*model.Agent
- func FindAgentByName(agents []*model.Agent, name string) *model.Agent
- func GenerateMatches(gameCount int, teamCount int, roles []model.Role, ...) ([]map[model.Role][]int, float64)
- func GenerateProfiles(config model.DynamicProfileConfig, profileEncoding map[string]string, size int) ([]model.Profile, error)
- func GetCandidates(votes []model.Vote, condition func(model.Vote) bool) []model.Agent
- func GetDuration(ffprobePath string, args []string, targetPath string) (float64, error)
- func GetRoleMap(agents []*model.Agent) map[model.Agent]model.Role
- func GetRoleTeamNamesMap(agents []*model.Agent) map[model.Role][]string
- func IdxMatchToTeamNameMatch(idxTeamMap map[int]string, match map[model.Role][]int) map[model.Role][]string
- func IsValidPlayerToken(secret string, tokenString string, team string) bool
- func IsValidReceiver(secret string, tokenString string) bool
- func SelectRandomAgent(agents []model.Agent) model.Agent
- func TeamNameMatchToIdxMatch(idxTeamMap map[int]string, match map[model.Role][]string) map[model.Role][]int
- func TrimLength(text string, length int, inWord bool, countSpaces bool) string
- type ChatCompletionRequest
- type ChatCompletionResponse
- type Choice
- type ContentItem
- type ConvertWavToSegmentParams
- type ImageURL
- type JSONSchema
- type Message
- type ProfileData
- type ResponseFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcDeviation ¶
func CalcHasErrorAgents ¶
func CalcTheoretical ¶
func ConvertWavToSegment ¶ added in v0.3.13
func ConvertWavToSegment(params ConvertWavToSegmentParams) ([]string, error)
func CreateAgents ¶
func CreateAgentsWithProfiles ¶ added in v0.3.9
func CreateAgentsWithRole ¶
func CreateAgentsWithRoleAndProfile ¶ added in v0.3.1
func FilterAgents ¶
func GenerateMatches ¶
func GenerateProfiles ¶ added in v0.3.9
func GetCandidates ¶
func GetDuration ¶ added in v0.3.13
func IdxMatchToTeamNameMatch ¶
func IsValidPlayerToken ¶
func IsValidReceiver ¶
func TeamNameMatchToIdxMatch ¶
Types ¶
type ChatCompletionRequest ¶ added in v0.3.9
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
ResponseFormat ResponseFormat `json:"response_format"`
MaxTokens int `json:"max_tokens"`
}
type ChatCompletionResponse ¶ added in v0.3.9
type ChatCompletionResponse struct {
Choices []Choice `json:"choices"`
}
type Choice ¶ added in v0.3.9
type Choice struct {
Message struct {
Content string `json:"content"`
} `json:"message"`
}
type ContentItem ¶ added in v0.3.9
type ConvertWavToSegmentParams ¶ added in v0.3.13
type JSONSchema ¶ added in v0.3.9
type JSONSchema struct {
Name string `json:"name"`
Strict bool `json:"strict"`
Schema json.RawMessage `json:"schema"`
}
type Message ¶ added in v0.3.9
type Message struct {
Role string `json:"role"`
Content []ContentItem `json:"content"`
}
type ProfileData ¶ added in v0.3.9
type ResponseFormat ¶ added in v0.3.9
type ResponseFormat struct {
Type string `json:"type"`
JSONSchema JSONSchema `json:"json_schema"`
}
Click to show internal directories.
Click to hide internal directories.