steamship.agents package#

Subpackages#

Submodules#

steamship.agents.logging module#

class steamship.agents.logging.AgentLogging[source]#

Bases: object

These keys are for use in the extra field of agent logging operations. #noqa: RST203

For now, they are manually applied at the time of logging. In the future, the AgentContext may provide a logger which fills some automatically.

For example:

logging.info(“I should use tool MakeAPicture”, extra={

AgentLogging.AGENT_NAME: self.name, AgentLogging.IS_AGENT_MESSAGE: True, AgentLogging.MESSAGE_TYPE: AgentLogging.THOUGHT

}) # noqa: RST203

This provides:

  • Structured additions to Fluent/Elastic that help with internal debugging.

  • Helpful output in development mode

  • [Eventual] User-visible logs

  • [Eventual] Visualiations about tool execution and ReAct reasoning

ACTION = 'action'#
AGENT = 'agent'#
AGENT_NAME = 'agent_name'#
IS_MESSAGE = 'is_message'#
MESSAGE = 'message'#
MESSAGE_AUTHOR = 'message_author'#
MESSAGE_TYPE = 'agent_message_type'#
OBSERVATION = 'observation'#
SYSTEM = 'system'#
THOUGHT = 'thought'#
TOOL = 'tool'#
TOOL_NAME = 'tool_name'#
USER = 'user'#

steamship.agents.utils module#

steamship.agents.utils.get_llm(context: AgentContext) Optional[LLM][source]#

Retrieves the LLM from the provided AgentContext (if it exists).

steamship.agents.utils.with_llm(llm: LLM, context: Optional[AgentContext] = None) AgentContext[source]#

Sets an LLM for general purpose lookup and usage on an AgentContext.

Module contents#