Skip to content

Commit

Permalink
Add info about Inject.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ric Szopa authored and Ric Szopa committed Jun 6, 2023
1 parent 2f53a7a commit c4182de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The heart and soul of Agency is the `agent.Agent` type. Its interface features t
- `Listen`: communicates text to the AI.
- `System`: sends a system message.
- `Respond`: receives responses from the agent.
- `Inject`: inject a message into the conversation history as if the agent had said it.

Below is a simple usage example:

Expand Down Expand Up @@ -42,7 +43,7 @@ if err != nil {
LLMs have a token limitation within their context window. Agency addresses this by providing the option to give an agent a memory, using the agent.WithMemory option:

```go
ag := agent.New("Funes", agent.WithClient(client), agent.WithMemory(agent.TokenBufferMemory(0.9))
ag := agent.New("Funes", agent.WithClient(client), agent.WithMemory(agent.TokenBufferMemory(3000))
```

Agency offers several memory implementations (`agent.BufferMemory`, `agent.TokenBufferMemory`, and `agent.SummarizerMemory`). If these don't fit your needs, you can implement your own by adhering to the agent.Memory interface, which is simply a function that takes in a context, configuration, and list of openai.ChatCompletionMessage, and returns a modified list of messages.
Expand Down

0 comments on commit c4182de

Please sign in to comment.