mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-13 06:40:25 +08:00
feat(model): add Cloner to Protocol
This commit is contained in:
@@ -22,7 +22,7 @@ type Requester interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Cloner interface {
|
type Cloner interface {
|
||||||
Clone() Cloner
|
Clone() Protocol
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessageBuilder[T any] interface {
|
type MessageBuilder[T any] interface {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ func (opai *GenAI) Assistant(prompt ...Content) Protocol {
|
|||||||
return opai
|
return opai
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opai *GenAI) Clone() Cloner {
|
func (opai *GenAI) Clone() Protocol {
|
||||||
x := new(GenAI)
|
x := new(GenAI)
|
||||||
*x = *opai
|
*x = *opai
|
||||||
x.SystemInstruction = nil
|
x.SystemInstruction = nil
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ func (ollm *OLLaMA) Assistant(prompt ...Content) Protocol {
|
|||||||
return ollm
|
return ollm
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ollm *OLLaMA) Clone() Cloner {
|
func (ollm *OLLaMA) Clone() Protocol {
|
||||||
x := new(OLLaMA)
|
x := new(OLLaMA)
|
||||||
*x = *ollm
|
*x = *ollm
|
||||||
x.Messages = nil
|
x.Messages = nil
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ func (opai *OpenAI) Assistant(prompt ...Content) Protocol {
|
|||||||
return opai.normal("assistant", prompt...)
|
return opai.normal("assistant", prompt...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opai *OpenAI) Clone() Cloner {
|
func (opai *OpenAI) Clone() Protocol {
|
||||||
x := new(OpenAI)
|
x := new(OpenAI)
|
||||||
*x = *opai
|
*x = *opai
|
||||||
x.Choices = nil
|
x.Choices = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user