From ed1290950d329ece15452f4ba589532060981929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 22 Feb 2025 01:08:12 +0900 Subject: [PATCH] feat: add ollama-compatibility --- model/api.go | 4 ++-- model/ollama.go | 4 ++-- model/openai.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model/api.go b/model/api.go index 096196d..6ea493a 100644 --- a/model/api.go +++ b/model/api.go @@ -21,8 +21,8 @@ type MessageBuilder[T any] interface { Assistant(prompt string) T } -type Protocol[T any] interface { +type Protocol interface { Inputer Outputer - MessageBuilder[T] + MessageBuilder[Protocol] } diff --git a/model/ollama.go b/model/ollama.go index 5cb9dd8..25fca44 100644 --- a/model/ollama.go +++ b/model/ollama.go @@ -8,8 +8,8 @@ import ( // OLLaMA as an specified example. type OLLaMA struct { - sep string - Protocol[*OLLaMA] `json:"-"` + sep string + Protocol `json:"-"` // callback only ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` diff --git a/model/openai.go b/model/openai.go index d274e56..33e6dbe 100644 --- a/model/openai.go +++ b/model/openai.go @@ -23,8 +23,8 @@ type Choice struct { // OpenAI as an specified example. type OpenAI struct { - sep string - Protocol[*OpenAI] `json:"-"` + sep string + Protocol `json:"-"` // callback only ID string `json:"id,omitempty"` Object string `json:"object,omitempty"`