mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-24 22:30:31 +08:00
feat: add ollama-compatibility
This commit is contained in:
@@ -21,8 +21,8 @@ type MessageBuilder[T any] interface {
|
|||||||
Assistant(prompt string) T
|
Assistant(prompt string) T
|
||||||
}
|
}
|
||||||
|
|
||||||
type Protocol[T any] interface {
|
type Protocol interface {
|
||||||
Inputer
|
Inputer
|
||||||
Outputer
|
Outputer
|
||||||
MessageBuilder[T]
|
MessageBuilder[Protocol]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
// OLLaMA as an specified example.
|
// OLLaMA as an specified example.
|
||||||
type OLLaMA struct {
|
type OLLaMA struct {
|
||||||
sep string
|
sep string
|
||||||
Protocol[*OLLaMA] `json:"-"`
|
Protocol `json:"-"`
|
||||||
// callback only
|
// callback only
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Object string `json:"object,omitempty"`
|
Object string `json:"object,omitempty"`
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ type Choice struct {
|
|||||||
|
|
||||||
// OpenAI as an specified example.
|
// OpenAI as an specified example.
|
||||||
type OpenAI struct {
|
type OpenAI struct {
|
||||||
sep string
|
sep string
|
||||||
Protocol[*OpenAI] `json:"-"`
|
Protocol `json:"-"`
|
||||||
// callback only
|
// callback only
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Object string `json:"object,omitempty"`
|
Object string `json:"object,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user