Enhance Message Filtering in LLM Context Conversion
- Added logic to skip internal message types ("tool_call", "loading", "action", "event") during LLM context conversion to prevent confusion, while retaining "error" messages for troubleshooting purposes.
- Improved clarity in the handling of message types to ensure only relevant content is processed for LLM interactions.
This commit is contained in:
parent
195391afaa
commit
4d1b427634
1 changed files with 8 additions and 0 deletions
|
|
@ -161,6 +161,14 @@ func (ast *Assistant) convertStoreMessageToContext(msg *storetypes.Message) *age
|
|||
return nil
|
||||
}
|
||||
|
||||
// Skip internal message types that should not be included in LLM context
|
||||
// These types are for UI/internal use only and can confuse the LLM
|
||||
// Note: "error" is kept so LLM can help troubleshoot issues
|
||||
switch msg.Type {
|
||||
case "tool_call", "loading", "action", "event":
|
||||
return nil
|
||||
}
|
||||
|
||||
// Extract content from Props
|
||||
content := ast.extractContentFromProps(msg.Props, msg.Type)
|
||||
if content == nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue