aboutsummaryrefslogtreecommitdiffstats
path: root/types.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-10-28 22:28:16 +0000
committerterminaldweller <devi@terminaldweller.com>2024-10-28 22:28:16 +0000
commite22d58cee6d9bb963f879fde8890e7743269afb3 (patch)
tree7521268ce29b4fca3b97bfe7451a828b7b880ca5 /types.go
parentadded a new option, context. fixed a bug with the custom commands where the c... (diff)
downloadmilla-e22d58cee6d9bb963f879fde8890e7743269afb3.tar.gz
milla-e22d58cee6d9bb963f879fde8890e7743269afb3.zip
added openrouter as a provider
Diffstat (limited to '')
-rw-r--r--types.go31
1 files changed, 30 insertions, 1 deletions
diff --git a/types.go b/types.go
index 1fc09dc..b976840 100644
--- a/types.go
+++ b/types.go
@@ -56,7 +56,7 @@ type TomlConfig struct {
IrcNick string `toml:"ircNick"`
IrcSaslUser string `toml:"ircSaslUser"`
IrcSaslPass string `toml:"ircSaslPass"`
- OllamaEndpoint string `toml:"ollamaEndpoint"`
+ Endpoint string `toml:"endpoint"`
Model string `toml:"model"`
ChromaStyle string `toml:"chromaStyle"`
ChromaFormatter string `toml:"chromaFormatter"`
@@ -79,6 +79,7 @@ type TomlConfig struct {
WebIRCHostname string `toml:"webIRCHostname"`
WebIRCAddress string `toml:"webIRCAddress"`
RSSFile string `toml:"rssFile"`
+ AnthropicVersion string `toml:"anthropicVersion"`
Plugins []string `toml:"plugins"`
Context []string `toml:"context"`
CustomCommands map[string]CustomCommand `toml:"customCommands"`
@@ -176,6 +177,34 @@ type OllamaChatRequest struct {
Messages []MemoryElement `json:"messages"`
}
+type ORMessage struct {
+ Role string `json:"role"`
+ Content string `json:"content"`
+ Refusal string `json:"refusal"`
+}
+
+type ORChoice struct {
+ FinishReason string `json:"finish_reason"`
+ Index int `json:"index"`
+ Message ORMessage `json:"message"`
+}
+
+type ORUsage struct {
+ PromptTokens int `json:"prompt_tokens"`
+ CompletionTokens int `json:"completion_tokens"`
+ TotalTokens int `json:"total_tokens"`
+}
+type ORResponse struct {
+ Id string `json:"id"`
+ Provider string `json:"provider"`
+ Model string `json:"model"`
+ Object string `json:"object"`
+ Created int64 `json:"created"`
+ Choices []ORChoice `json:"choices"`
+ SystemFingerprint string `json:"system_fingerprint"`
+ Usage ORUsage `json:"usage"`
+}
+
type MemoryElement struct {
Role string `json:"role"`
Content string `json:"content"`