Skip to content

Commit

Permalink
add attributes to room/item description, fix circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 5, 2024
1 parent 8a4ecd2 commit cad8e2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions taleweave/utils/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from jinja2 import Environment

from taleweave.context import get_prompt_library

# from taleweave.utils.conversation import summarize_room
from taleweave.utils.string import and_list, or_list
from taleweave.utils.world import describe_entity, name_entity

Expand All @@ -13,7 +11,6 @@
jinja_env = Environment()
jinja_env.filters["describe"] = describe_entity
jinja_env.filters["name"] = name_entity
# jinja_env.filters["summary"] = summarize_room
jinja_env.filters["and_list"] = and_list
jinja_env.filters["or_list"] = or_list

Expand Down
9 changes: 7 additions & 2 deletions taleweave/utils/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ def describe_character(


def describe_static(entity: WorldEntity) -> str:
# TODO: include attributes
return entity.description
attribute_descriptions = format_attributes(entity)
logger.info(
"describing entity: %s, attributes: '%s'",
entity.name,
attribute_descriptions,
)
return f"{entity.description} {attribute_descriptions}"


def describe_entity(
Expand Down

0 comments on commit cad8e2d

Please sign in to comment.