[+]删除链路追踪,修改项目名称

This commit is contained in:
renzhiyuan 2025-09-10 12:00:44 +08:00
parent 458c8894b4
commit 285bba38f1
6 changed files with 12 additions and 5 deletions

View File

@ -31,9 +31,9 @@ func main() {
gin.SetMode(gin.ReleaseMode)
} else {
gin.SetMode(gin.DebugMode)
//config.SetEnv()
}
}
//config.SetEnv()
// Build dependency injection container
c := container.BuildContainer(runtime.GetContainer())

View File

@ -200,12 +200,13 @@ conversation:
repeat_penalty: 1.0
temperature: 0.3
max_completion_tokens: 2048
thinking: true
no_match_prefix: |-
<think>
</think>
NO_MATCH
prompt: |
这是用户和助手之间的对话。当用户提出问题时,助手会基于特定的信息进行解答。直接提供答案,没有思考过程
这是用户和助手之间的对话。当用户提出问题时,助手会基于特定的信息进行解答。直接提供答案
context_template: |
## 回答问题规则
- 回答问题仅依据检索到的信息中的事实,不利用任何先验知识。

View File

@ -22,6 +22,7 @@ func prepareChatModel(ctx context.Context, modelService interfaces.ModelService,
}
logger.Info(ctx, "Setting up chat options")
opt := &chat.ChatOptions{
Temperature: chatManage.SummaryConfig.Temperature,
TopP: chatManage.SummaryConfig.TopP,
@ -30,7 +31,7 @@ func prepareChatModel(ctx context.Context, modelService interfaces.ModelService,
MaxCompletionTokens: chatManage.SummaryConfig.MaxCompletionTokens,
FrequencyPenalty: chatManage.SummaryConfig.FrequencyPenalty,
PresencePenalty: chatManage.SummaryConfig.PresencePenalty,
Thinking: chatManage.SummaryConfig.Thinking,
Thinking: &chatManage.SummaryConfig.Thinking,
}
return chatModel, opt, nil

View File

@ -81,6 +81,7 @@ type SummaryConfig struct {
Seed int `yaml:"seed" json:"seed"`
MaxCompletionTokens int `yaml:"max_completion_tokens" json:"max_completion_tokens"`
NoMatchPrefix string `yaml:"no_match_prefix" json:"no_match_prefix"`
Thinking bool `yaml:"thinking" json:"thinking"`
}
// ServerConfig 服务器配置

View File

@ -74,6 +74,7 @@ type SessionStrategy struct {
SummaryParameters *types.SummaryConfig `json:"summary_parameters" gorm:"type:json"`
// Prefix for responses when no match is found
NoMatchPrefix string `json:"no_match_prefix"`
Thinking bool `json:"thinking"`
}
// CreateSessionRequest represents a request to create a new session
@ -141,6 +142,7 @@ func (h *SessionHandler) CreateSession(c *gin.Context) {
createdSession.RerankThreshold = request.SessionStrategy.RerankThreshold
if request.SessionStrategy.SummaryParameters != nil {
createdSession.SummaryParameters = request.SessionStrategy.SummaryParameters
createdSession.SummaryParameters.Thinking = true
} else {
createdSession.SummaryParameters = &types.SummaryConfig{
MaxTokens: h.config.Conversation.Summary.MaxTokens,
@ -153,6 +155,7 @@ func (h *SessionHandler) CreateSession(c *gin.Context) {
Temperature: h.config.Conversation.Summary.Temperature,
Seed: h.config.Conversation.Summary.Seed,
MaxCompletionTokens: h.config.Conversation.Summary.MaxCompletionTokens,
Thinking: h.config.Conversation.Summary.Thinking,
}
}
if createdSession.SummaryParameters.Prompt == "" {
@ -190,6 +193,7 @@ func (h *SessionHandler) CreateSession(c *gin.Context) {
Temperature: h.config.Conversation.Summary.Temperature,
Seed: h.config.Conversation.Summary.Seed,
MaxCompletionTokens: h.config.Conversation.Summary.MaxCompletionTokens,
Thinking: h.config.Conversation.Summary.Thinking,
}
logger.Debug(ctx, "Using default session strategy")

View File

@ -43,7 +43,7 @@ type SummaryConfig struct {
// Max completion tokens
MaxCompletionTokens int `json:"max_completion_tokens"`
// Think
Thinking *bool `json:"thinking"`
Thinking bool `json:"thinking"`
}
// Session represents the session