mirror of
https://github.com/microsoft/autogen.git
synced 2025-12-26 14:38:50 +00:00
Add documentation (#68)
* initial docs * update docs * Update agent.md * Update memory.md * Update runtime.md --------- Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
This commit is contained in:
parent
178e209e5f
commit
1dc22d9672
24
docs/src/core-concepts/agent.md
Normal file
24
docs/src/core-concepts/agent.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Agent
|
||||
|
||||
An agent in AGNext is an entity that can react to, send, and publish
|
||||
messages. Messages are the only means through which agents can communicate
|
||||
with each others.
|
||||
|
||||
## TypeRoutedAgent
|
||||
|
||||
`agnext.components.TypeRoutedAgent`
|
||||
is a base class for building custom agents. It provides
|
||||
a simple API for associating message types with message handlers.
|
||||
Here is an example of simple agent that reacts to `TextMessage`:
|
||||
|
||||
```python
|
||||
from agnext.chat.types import TextMessage
|
||||
from agnext.components import TypeRoutedAgent, message_handler
|
||||
from agnext.core import AgentRuntime, CancellationToken
|
||||
|
||||
class MyAgent(TypeRoutedAgent):
|
||||
|
||||
@message_handler()
|
||||
async def on_text_message(self, message: TextMessage, cancellation_token: CancellationToken)) -> None:
|
||||
await self._publish(TextMessage(content=f"I received this message: ({message.content}) from {message.source}"))
|
||||
```
|
||||
7
docs/src/core-concepts/memory.md
Normal file
7
docs/src/core-concepts/memory.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Memory
|
||||
|
||||
Memory is a collection of data corresponding to the conversation history
|
||||
of an agent.
|
||||
Data in meory can be just a simple list of all messages, or a sightly more
|
||||
realistic one which provides a view of the last N messages
|
||||
(`agnext.chat.memory.BufferedChatMemory`).
|
||||
1
docs/src/core-concepts/patterns.md
Normal file
1
docs/src/core-concepts/patterns.md
Normal file
@ -0,0 +1 @@
|
||||
# Multi-Agent Patterns
|
||||
12
docs/src/core-concepts/runtime.md
Normal file
12
docs/src/core-concepts/runtime.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Agent Runtime
|
||||
|
||||
Agent runtime is the execution environment for agents in AGNext.
|
||||
Similar to the runtime environment of a programming language, the
|
||||
agent runtime provides the necessary infrastructure to facilitate communication
|
||||
between agents, manage agent states, and provide API for monitoring and
|
||||
debugging multi-agent interactions.
|
||||
|
||||
Further readings:
|
||||
|
||||
1. `agnext.core.AgentRuntime`
|
||||
2. `agnext.application.SingleThreadedAgentRuntime`
|
||||
1
docs/src/core-concepts/tools.md
Normal file
1
docs/src/core-concepts/tools.md
Normal file
@ -0,0 +1 @@
|
||||
# Tools
|
||||
1
docs/src/getting-started/contributing.md
Normal file
1
docs/src/getting-started/contributing.md
Normal file
@ -0,0 +1 @@
|
||||
# Contributing to AGNext
|
||||
1
docs/src/getting-started/tutorial.md
Normal file
1
docs/src/getting-started/tutorial.md
Normal file
@ -0,0 +1 @@
|
||||
# Tutorial
|
||||
@ -6,6 +6,18 @@ agnext
|
||||
:hidden:
|
||||
|
||||
getting-started/installation
|
||||
getting-started/tutorial
|
||||
getting-started/contributing
|
||||
|
||||
.. toctree::
|
||||
:caption: Core Concepts
|
||||
:hidden:
|
||||
|
||||
core-concepts/runtime
|
||||
core-concepts/agent
|
||||
core-concepts/patterns
|
||||
core-concepts/memory
|
||||
core-concepts/tools
|
||||
|
||||
.. toctree::
|
||||
:caption: Guides
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user