Files
Sycun cfaa95d7bd refactor(runtime): remove Eino and make Pi the sole agent engine
Delete the Eino model adapters, callbacks, middleware, orchestration,
summarization and single-agent runner together with their dependencies.
Chat, batch tasks, workflow Agent nodes and sub-agents now share the Pi
runtime, and dispatch is a single code path instead of an engine switch.

Configuration migrates eino_middleware/eino_skills to runtime/skills and
drops the retired callback settings while old files still load. Settings,
i18n and docs describe Pi only. Also carry the Pi follow-up fixes: empty
required lists are omitted from tool schemas, historical tool results stay
with their call batch, model proxies work over HTTP/1.1, single-query
retrieval skips query expansion, and finalization docs match Pi lifecycle
events.
2026-11-12 17:55:36 +08:00

37 lines
1.0 KiB
Go

package reasoning
import (
"strings"
"cyberstrike-ai/internal/config"
)
// effectiveModeForModel accepts effort=none only for known native OpenAI
// models. Other providers keep their existing effort normalization and fallback.
func effectiveModeForModel(oa *config.OpenAIConfig, client *ClientIntent) string {
sr := &oa.Reasoning
allowClient := sr.AllowClientReasoningEffective()
mode := effectiveMode(sr, client, allowClient)
if !oa.SupportsOpenAIReasoningNone() {
return mode
}
effort := sr.Effort
if allowClient && client != nil && (normalizeEffort(client.Effort) != "" || strings.EqualFold(strings.TrimSpace(client.Effort), "none")) {
effort = client.Effort
}
if strings.EqualFold(strings.TrimSpace(effort), "none") {
return "off"
}
return mode
}
func openAIReasoningDisabledFields(fields map[string]any, oa *config.OpenAIConfig) map[string]any {
if oa.SupportsOpenAIReasoningNone() {
if fields == nil {
fields = make(map[string]any)
}
fields["reasoning_effort"] = "none"
}
return fields
}