Skip to content

Commit

Permalink
move agent components from component/agent/v2 folder to component/age…
Browse files Browse the repository at this point in the history
…nt. Should also fix the problem introduced by moving old components to to_be_deprecated.

PiperOrigin-RevId: 662436269
Change-Id: Ic3fda58e9f1414fb9857899313a2621c272e7a90
  • Loading branch information
vezhnick authored and copybara-github committed Aug 13, 2024
1 parent a35026e commit d6a228a
Show file tree
Hide file tree
Showing 36 changed files with 677 additions and 491 deletions.
2 changes: 1 addition & 1 deletion concordia/agents/entity_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import types
from typing import cast

from concordia.components.agent.v2 import no_op_context_processor
from concordia.components.agent import no_op_context_processor
from concordia.typing import entity
from concordia.typing import entity_component
from concordia.utils import concurrency
Expand Down
33 changes: 33 additions & 0 deletions concordia/components/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Library of components specifically for generative agents."""

from concordia.components.agent import action_spec_ignored
from concordia.components.agent import all_similar_memories
from concordia.components.agent import concat_act_component
from concordia.components.agent import constant
from concordia.components.agent import instructions
from concordia.components.agent import justify_recent_voluntary_actions
from concordia.components.agent import legacy_act_component
from concordia.components.agent import memory_component
from concordia.components.agent import no_op_context_processor
from concordia.components.agent import observation
from concordia.components.agent import plan
from concordia.components.agent import question_of_query_associated_memories
from concordia.components.agent import question_of_recent_memories
from concordia.components.agent import relationships
from concordia.components.agent import report_function
from concordia.components.agent import scheduled_hint
from concordia.components.agent import simple_act_component
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from collections.abc import Mapping
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""A simple acting component that aggregates contexts from components."""

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent import action_spec_ignored
from concordia.typing import logging

DEFAULT_PRE_ACT_KEY = 'Constant'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Component that provides the default role playing instructions to an agent."""

from concordia.components.agent.v2 import constant
from concordia.components.agent import constant
from concordia.typing import logging

DEFAULT_INSTRUCTIONS_PRE_ACT_KEY = 'Role playing instructions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import datetime
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
import datetime
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model

from concordia.memory_bank import legacy_associative_memory
from concordia.typing import logging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import datetime
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent.v2 import observation
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.components.agent import observation
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from collections.abc import Callable, Sequence
import datetime

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import datetime
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from collections.abc import Sequence

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""

from typing import Callable
from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent import action_spec_ignored
from concordia.typing import logging

DEFAULT_PRE_ACT_KEY = 'Report'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import datetime
import types

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent import action_spec_ignored
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.typing import entity_component
Expand Down
33 changes: 0 additions & 33 deletions concordia/components/agent/v2/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions concordia/contrib/components/agent/v2/affect_reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import types

from concordia.clocks import game_clock
from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import types
from typing import Callable, Mapping

from concordia.components.agent.v2 import action_spec_ignored
from concordia.components.agent.v2 import memory_component
from concordia.components.agent import action_spec_ignored
from concordia.components.agent import memory_component
from concordia.document import interactive_document
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
Expand Down
2 changes: 1 addition & 1 deletion concordia/factory/agent/basic_entity_agent__main_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from concordia.associative_memory import associative_memory
from concordia.associative_memory import formative_memories
from concordia.clocks import game_clock
from concordia.components.agent import v2 as agent_components
from concordia.components import agent as agent_components
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
from concordia.utils import measurements as measurements_lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from concordia.associative_memory import associative_memory
from concordia.associative_memory import formative_memories
from concordia.clocks import game_clock
from concordia.components.agent import v2 as agent_components
from concordia.components import agent as agent_components
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
from concordia.typing import entity_component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from concordia.associative_memory import associative_memory
from concordia.associative_memory import formative_memories
from concordia.clocks import game_clock
from concordia.components.agent import v2 as agent_components
from concordia.components import agent as agent_components
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
from concordia.utils import measurements as measurements_lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from concordia.associative_memory import associative_memory
from concordia.associative_memory import formative_memories
from concordia.clocks import game_clock
from concordia.components.agent import v2 as agent_components
from concordia.components import agent as agent_components
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
from concordia.typing import entity_component
Expand Down
2 changes: 1 addition & 1 deletion concordia/factory/agent/synthetic_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from concordia.associative_memory import associative_memory
from concordia.associative_memory import formative_memories
from concordia.clocks import game_clock
from concordia.components.agent import v2 as components
from concordia.components import agent as components
from concordia.language_model import language_model
from concordia.memory_bank import legacy_associative_memory
from concordia.utils import measurements as measurements_lib
Expand Down
Loading

0 comments on commit d6a228a

Please sign in to comment.