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

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) gin.SetMode(gin.ReleaseMode)
} else { } else {
gin.SetMode(gin.DebugMode) gin.SetMode(gin.DebugMode)
//config.SetEnv()
}
}
//config.SetEnv()
// Build dependency injection container // Build dependency injection container
c := container.BuildContainer(runtime.GetContainer()) c := container.BuildContainer(runtime.GetContainer())

View File

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

View File

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

View File

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

View File

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

View File

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