model

package
v0.0.0-...-5bc8fce Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LimitMessage     = "本日の利用制限を超えました。明日以降に再度お試しください。"
	MaxFetchMessages = 20
)
View Source
const CharacterSettings = `` /* 2167-byte string literal not displayed */
View Source
const (
	DailyTokenLimit = 20000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BotMessage

type BotMessage struct {
	Client       *slack.Client
	ChannelID    string
	OutputTS     string
	ControllerTS string
}

type SlackMessage

type SlackMessage struct {
	Text string // メッセージの内容
	User string // メッセージを送信したユーザーのID
}

func (*SlackMessage) OptimizeMessage

func (m *SlackMessage) OptimizeMessage(botUserID string) string

type SlackMessages

type SlackMessages []SlackMessage

func ConvertToSlackMessages

func ConvertToSlackMessages(messages []slack.Message) SlackMessages

func (SlackMessages) CreatePrompt

func (messages SlackMessages) CreatePrompt(botUserID string) string

func (SlackMessages) LimitMessages

func (messages SlackMessages) LimitMessages(maxMessages int) SlackMessages

type SpreadsheetData

type SpreadsheetData struct {
	UserID           string
	TotalUsage       int
	LastUsedAt       string
	TokensUsage      int
	DailyTokensUsage int
	TotalTokensUsage int
}

func NewSpreadsheet

func NewSpreadsheet(
	userID string,
	totalUsage int,
	lastUsedAt string,
	tokensUsage int,
	dailyTokensUsage int,
	totalTokensUsage int,
) *SpreadsheetData

func (*SpreadsheetData) AddTokenUsage

func (s *SpreadsheetData) AddTokenUsage(tokens int)

func (*SpreadsheetData) CanUseDailyTokens

func (s *SpreadsheetData) CanUseDailyTokens() error

func (*SpreadsheetData) ResetDailyUsageIfNeeded

func (s *SpreadsheetData) ResetDailyUsageIfNeeded()

type SpreadsheetID

type SpreadsheetID string

Jump to

Keyboard shortcuts

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