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:
@@ -192,7 +192,7 @@ class BasicAgentAgentStrategy(AgentStrategy):
|
||||
params = BasicParams(**parameters)
|
||||
```
|
||||
|
||||
### 2.3 Invoking the Model
|
||||
#### 2.3 Invoking the Model
|
||||
|
||||
In an Agent Strategy Plugin, **invoking the model** is central to the workflow. You can invoke an LLM efficiently using `session.model.llm.invoke()` from the SDK, handling text generation, dialogue, and so forth.
|
||||
|
||||
@@ -225,7 +225,7 @@ This code achieves the following functionality: after a user inputs a command, t
|
||||
|
||||

|
||||
|
||||
### 2.4 Adding Memory to the Model
|
||||
#### 2.4 Adding Memory to the Model
|
||||
|
||||
Adding **Memory** to your Agent plugin allows the model to remember previous conversations, making interactions more natural and effective. With memory enabled, the model can maintain context and provide more relevant responses.
|
||||
|
||||
@@ -313,7 +313,7 @@ After implementing **Memory**, the model can respond based on conversation histo
|
||||
|
||||

|
||||
|
||||
### 2.5 Handling a Tool
|
||||
#### 2.5 Handling a Tool
|
||||
|
||||
After specifying the tool parameters, the Agent Strategy Plugin must actually call these tools. Use `session.tool.invoke()` to make those requests.
|
||||
|
||||
@@ -355,7 +355,7 @@ With this in place, your Agent Strategy Plugin can automatically perform **Funct
|
||||
|
||||

|
||||
|
||||
### 2.6 Creating Logs
|
||||
#### 2.6 Creating Logs
|
||||
|
||||
Often, multiple steps are necessary to complete a complex task in an **Agent Strategy Plugin**. It's crucial for developers to track each step's results, analyze the decision process, and optimize strategy. Using `create_log_message` and `finish_log_message` from the SDK, you can log real-time states before and after calls, aiding in quick problem diagnosis.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user