Skip to content

Commit

Permalink
Fix typing error and improve docstrings of components that use other …
Browse files Browse the repository at this point in the history
…components.

PiperOrigin-RevId: 653983035
Change-Id: I12acaa2129cf61304a0f677f6da796543aba3632
  • Loading branch information
duenez authored and copybara-github committed Jul 19, 2024
1 parent a619d2b commit 1e273c1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
7 changes: 3 additions & 4 deletions concordia/components/agent/v2/all_similar_memories.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def __init__(
model: language_model.LanguageModel,
memory_component_name: str = (
memory_component.DEFAULT_MEMORY_COMPONENT_NAME),
components: Mapping[str, action_spec_ignored.ActionSpecIgnored] = (
types.MappingProxyType({})
),
components: Mapping[str, str] = types.MappingProxyType({}),
num_memories_to_retrieve: int = 25,
pre_act_key: str = 'Relevant memories',
logging_channel: logging.LoggingChannel = logging.NoOpLoggingChannel,
Expand All @@ -50,7 +48,8 @@ def __init__(
model: The language model to use.
memory_component_name: The name of the memory component from which to
retrieve related memories.
components: The components to condition the answer on.
components: The components to condition the answer on. This is a mapping
of the component name to a prefix to use in the prompt.
num_memories_to_retrieve: The number of memories to retrieve.
pre_act_key: Prefix to add to the output of the component when called
in `pre_act`.
Expand Down
7 changes: 3 additions & 4 deletions concordia/components/agent/v2/person_by_situation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def __init__(
model: language_model.LanguageModel,
memory_component_name: str = (
memory_component.DEFAULT_MEMORY_COMPONENT_NAME),
components: Mapping[str, action_spec_ignored.ActionSpecIgnored] = (
types.MappingProxyType({})
),
components: Mapping[str, str] = types.MappingProxyType({}),
clock_now: Callable[[], datetime.datetime] | None = None,
num_memories_to_retrieve: int = 25,
pre_act_key: str = DEFAULT_PRE_ACT_KEY,
Expand All @@ -52,7 +50,8 @@ def __init__(
model: The language model to use.
memory_component_name: The name of the memory component from which to
retrieve recent memories.
components: The components to condition the answer on.
components: The components to condition the answer on. This is a mapping
of the component name to a prefix to use in the prompt.
clock_now: time callback to use.
num_memories_to_retrieve: The number of recent memories to retrieve.
pre_act_key: Prefix to add to the output of the component when called
Expand Down
7 changes: 3 additions & 4 deletions concordia/components/agent/v2/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def __init__(
observation_component_name: str,
memory_component_name: str = (
memory_component.DEFAULT_MEMORY_COMPONENT_NAME),
components: Mapping[str, action_spec_ignored.ActionSpecIgnored] = (
types.MappingProxyType({})
),
components: Mapping[str, str] = types.MappingProxyType({}),
clock_now: Callable[[], datetime.datetime] | None = None,
goal_component_name: str | None = None,
num_memories_to_retrieve: int = 10,
Expand All @@ -58,7 +56,8 @@ def __init__(
which to retrieve obervations.
memory_component_name: The name of the memory component from which to
retrieve memories
components: components to build the context of planning
components: components to build the context of planning. This is a mapping
of the component name to a prefix to use in the prompt.
clock_now: time callback to use for the state.
goal_component_name: index into `components` to use to represent the goal
of planning
Expand Down
7 changes: 3 additions & 4 deletions concordia/components/agent/v2/self_perception.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def __init__(
model: language_model.LanguageModel,
memory_component_name: str = (
memory_component.DEFAULT_MEMORY_COMPONENT_NAME),
components: Mapping[str, action_spec_ignored.ActionSpecIgnored] = (
types.MappingProxyType({})
),
components: Mapping[str, str] = types.MappingProxyType({}),
num_memories_to_retrieve: int = 100,
pre_act_key: str = DEFAULT_PRE_ACT_KEY,
logging_channel: logging.LoggingChannel = logging.NoOpLoggingChannel,
Expand All @@ -48,7 +46,8 @@ def __init__(
model: Language model.
memory_component_name: The name of the memory component from which to
retrieve recent memories.
components: The components to condition the answer on.
components: The components to condition the answer on. This is a mapping
of the component name to a prefix to use in the prompt.
num_memories_to_retrieve: Number of memories to retrieve.
pre_act_key: Prefix to add to the output of the component when called
in `pre_act`.
Expand Down
7 changes: 3 additions & 4 deletions concordia/components/agent/v2/situation_perception.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def __init__(
model: language_model.LanguageModel,
memory_component_name: str = (
memory_component.DEFAULT_MEMORY_COMPONENT_NAME),
components: Mapping[str, action_spec_ignored.ActionSpecIgnored] = (
types.MappingProxyType({})
),
components: Mapping[str, str] = types.MappingProxyType({}),
clock_now: Callable[[], datetime.datetime] | None = None,
num_memories_to_retrieve: int = 25,
pre_act_key: str = DEFAULT_PRE_ACT_KEY,
Expand All @@ -49,7 +47,8 @@ def __init__(
model: The language model to use.
memory_component_name: The name of the memory component from which to
retrieve recent memories.
components: The components to condition the answer on.
components: The components to condition the answer on. This is a mapping
of the component name to a prefix to use in the prompt.
clock_now: time callback to use.
num_memories_to_retrieve: The number of recent memories to retrieve.
pre_act_key: Prefix to add to the output of the component when called
Expand Down

0 comments on commit 1e273c1

Please sign in to comment.