Changeset 0.9.0 (#50)
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
capspkg "git.gobha.me/xcaliber/chat-switchboard/capabilities"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/database"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/providers"
|
||||
)
|
||||
@@ -43,7 +44,7 @@ type editRequest struct {
|
||||
type regenerateRequest struct {
|
||||
Model string `json:"model,omitempty"`
|
||||
PresetID string `json:"preset_id,omitempty"`
|
||||
APIConfigID string `json:"api_config_id,omitempty"`
|
||||
APIConfigID string `json:"provider_config_id,omitempty"`
|
||||
MaxTokens int `json:"max_tokens,omitempty"`
|
||||
Temperature *float64 `json:"temperature,omitempty"`
|
||||
}
|
||||
@@ -369,8 +370,8 @@ func (h *MessageHandler) Regenerate(c *gin.Context) {
|
||||
if model == "" {
|
||||
model = preset.BaseModelID
|
||||
}
|
||||
if apiConfigID == "" && preset.APIConfigID != nil {
|
||||
apiConfigID = *preset.APIConfigID
|
||||
if apiConfigID == "" && preset.ProviderConfigID != nil {
|
||||
apiConfigID = *preset.ProviderConfigID
|
||||
}
|
||||
if temperature == nil && preset.Temperature != nil {
|
||||
temperature = preset.Temperature
|
||||
@@ -436,7 +437,7 @@ func (h *MessageHandler) Regenerate(c *gin.Context) {
|
||||
if maxTokens > 0 {
|
||||
provReq.MaxTokens = maxTokens
|
||||
} else {
|
||||
provReq.MaxTokens = providers.ResolveMaxOutput(model, caps)
|
||||
provReq.MaxTokens = capspkg.ResolveMaxOutput(model, caps)
|
||||
}
|
||||
if temperature != nil {
|
||||
provReq.Temperature = temperature
|
||||
|
||||
Reference in New Issue
Block a user