mirror of
https://github.com/langgenius/dify-docs-archived.git
synced 2026-07-01 20:35:52 -04:00
Update agent-strategy-plugin.md
This commit is contained in:
@@ -260,7 +260,7 @@ Once enabled, you can adjust the memory window size using the slider, which dete
|
||||
|
||||
3. Debug History Messages
|
||||
|
||||
Add the following code to inspect history message contents:
|
||||
Add the following code to check the history messages:
|
||||
|
||||
```python
|
||||
class BasicAgentAgentStrategy(AgentStrategy):
|
||||
@@ -272,7 +272,7 @@ class BasicAgentAgentStrategy(AgentStrategy):
|
||||
|
||||

|
||||
|
||||
The console will display output similar to:
|
||||
The console will display an output similar to:
|
||||
|
||||
```
|
||||
history_messages: []
|
||||
@@ -281,7 +281,7 @@ history_messages: [UserPromptMessage(role=<PromptMessageRole.USER: 'user'>, cont
|
||||
|
||||
4. Integrate History Messages into Model Calls
|
||||
|
||||
Modify the model invocation code to concatenate history messages with the current query:
|
||||
Update the model call to incorporate conversation history with the current query:
|
||||
|
||||
```python
|
||||
class BasicAgentAgentStrategy(AgentStrategy):
|
||||
@@ -309,7 +309,7 @@ class BasicAgentAgentStrategy(AgentStrategy):
|
||||
|
||||
5. Check the Outcome
|
||||
|
||||
After implementing memory, the model can respond based on conversation history. In the example below, the model successfully remembers the user’s name mentioned in previous conversation.
|
||||
After implementing **Memory**, the model can respond based on conversation history. In the example below, the model successfully remembers the user’s name mentioned in previous conversation.
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user