Add files via upload

This commit is contained in:
公明
2026-08-18 20:29:17 +08:00
committed by GitHub
parent 5eaddd9e8c
commit acc2ebd7e2
96 changed files with 11867 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package multiagent
import (
"context"
"github.com/cloudwego/eino/adk"
"github.com/cloudwego/eino/schema"
)
// literalInstructionGenModelInput passes Instruction through as a system message without
// FString template formatting. Eino defaultGenModelInput formats instruction whenever
// SessionValues exist; prompts with literal curly braces (project blackboard "{关系边: ...}",
// JSON examples, link syntax) then fail with "could not find key".
//
// Matches eino/adk/prebuilt/deep genModelInput — the supported fix per Eino docs.
func literalInstructionGenModelInput(ctx context.Context, instruction string, input *adk.AgentInput) ([]adk.Message, error) {
msgs := make([]adk.Message, 0, len(input.Messages)+1)
if instruction != "" {
msgs = append(msgs, schema.SystemMessage(instruction))
}
msgs = append(msgs, input.Messages...)
return msgs, nil
}
func literalAgenticInstructionGenModelInput(ctx context.Context, instruction string, input *adk.TypedAgentInput[*schema.AgenticMessage]) ([]*schema.AgenticMessage, error) {
msgs := make([]*schema.AgenticMessage, 0, len(input.Messages)+1)
if instruction != "" {
msgs = append(msgs, schema.SystemAgenticMessage(instruction))
}
msgs = append(msgs, input.Messages...)
return msgs, nil
}