Skip to content

Commit

Permalink
configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedrelick committed Aug 23, 2024
1 parent 3b3dc86 commit 58b59ae
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 27 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,46 @@ def deps do
end
```

## Configuration
Future versions of Agens will be configurable by providing options to `Agens.Supervisor` in order to [avoid using application configuration](https://hexdocs.pm/elixir/1.17.2/design-anti-patterns.html#using-application-configuration-for-libraries). For now, however, you can change the Agens `Registry` if needed via config:

```elixir
config :agens, registry: Agens.Registry
```

In addition, you can also override the prompt prefixes:

```elixir
config :agens, prompts: %{
prompt:
{"Agent",
"You are a specialized agent with the following capabilities and expertise"},
identity:
{"Identity",
"You are a specialized agent with the following capabilities and expertise"},
context: {"Context", "The purpose or goal behind your tasks are to"},
constraints:
{"Constraints", "You must operate with the following constraints or limitations"},
examples:
{"Examples",
"You should consider the following examples before returning results"},
reflection:
{"Reflection",
"You should reflect on the following factors before returning results"},
instructions:
{"Tool Instructions",
"You should provide structured output for function calling based on the following instructions"},
objective: {"Step Objective", "The objective of this step is to"},
description:
{"Job Description", "This is part of multi-step job to achieve the following"},
input:
{"Input",
"The following is the actual input from the user, system or another agent"}
}
```

See the [Prompting](#prompting) section below or `Agens.Message` for more information on prompt prefixes.

## Usage
Building a multi-agent workflow with Agens involves a few different steps and core entities:

Expand Down
21 changes: 20 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
import Config

config :agens, registry: Agens.Registry
config :agens,
registry: Agens.Registry,
prompts: %{
prompt:
{"Agent", "You are a specialized agent with the following capabilities and expertise"},
identity:
{"Identity", "You are a specialized agent with the following capabilities and expertise"},
context: {"Context", "The purpose or goal behind your tasks are to"},
constraints:
{"Constraints", "You must operate with the following constraints or limitations"},
examples: {"Examples", "You should consider the following examples before returning results"},
reflection:
{"Reflection", "You should reflect on the following factors before returning results"},
instructions:
{"Tool Instructions",
"You should provide structured output for function calling based on the following instructions"},
objective: {"Step Objective", "The objective of this step is to"},
description: {"Job Description", "This is part of multi-step job to achieve the following"},
input: {"Input", "The following is the actual input from the user, system or another agent"}
}
27 changes: 1 addition & 26 deletions lib/agens.ex
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,7 @@ defmodule Agens do
alias Agens.{Agent, Serving}

@registry Application.compile_env(:agens, :registry)
@fields Application.compile_env(:agens, :prompts, %{
prompt:
{"Agent",
"You are a specialized agent with the following capabilities and expertise"},
identity:
{"Identity",
"You are a specialized agent with the following capabilities and expertise"},
context: {"Context", "The purpose or goal behind your tasks are to"},
constraints:
{"Constraints", "You must operate with the following constraints or limitations"},
examples:
{"Examples",
"You should consider the following examples before returning results"},
reflection:
{"Reflection",
"You should reflect on the following factors before returning results"},
instructions:
{"Tool Instructions",
"You should provide structured output for function calling based on the following instructions"},
objective: {"Step Objective", "The objective of this step is to"},
description:
{"Job Description", "This is part of multi-step job to achieve the following"},
input:
{"Input",
"The following is the actual input from the user, system or another agent"}
})
@fields Application.compile_env(:agens, :prompts)

@doc """
Sends an `Agens.Message` to an `Agens.Agent`
Expand Down

0 comments on commit 58b59ae

Please sign in to comment.