steamship.agents package#
Subpackages#
- steamship.agents.examples package
- Submodules
- steamship.agents.examples.chatgpt_api module
- steamship.agents.examples.chatgpt_with_web_and_telegram module
- steamship.agents.examples.document_qa_agent module
- steamship.agents.examples.example_assistant module
- steamship.agents.examples.example_assistant_with_caching module
- steamship.agents.examples.example_react_assistant module
- steamship.agents.examples.fact_learner module
- steamship.agents.examples.telegram_bot module
- Module contents
- steamship.agents.functional package
- steamship.agents.llms package
- steamship.agents.mixins package
- steamship.agents.react package
- steamship.agents.schema package
- Submodules
- steamship.agents.schema.action module
- steamship.agents.schema.agent module
- steamship.agents.schema.cache module
- steamship.agents.schema.chathistory module
ChatHistory
ChatHistory.append_agent_message()
ChatHistory.append_assistant_message()
ChatHistory.append_llm_message()
ChatHistory.append_message_with_role()
ChatHistory.append_request_complete_message()
ChatHistory.append_status_message_with_role()
ChatHistory.append_system_message()
ChatHistory.append_tool_message()
ChatHistory.append_user_message()
ChatHistory.clear()
ChatHistory.client
ChatHistory.delete_messages()
ChatHistory.embedding_index
ChatHistory.file
ChatHistory.get_or_create()
ChatHistory.initial_system_prompt
ChatHistory.is_searchable()
ChatHistory.last_agent_message
ChatHistory.last_system_message
ChatHistory.last_user_message
ChatHistory.messages
ChatHistory.refresh()
ChatHistory.search()
ChatHistory.select_messages()
ChatHistory.tags
ChatHistory.text_splitter
ChatHistoryLoggingHandler
- steamship.agents.schema.context module
- steamship.agents.schema.functions module
- steamship.agents.schema.llm module
- steamship.agents.schema.message_selectors module
- steamship.agents.schema.output_parser module
- steamship.agents.schema.text_splitters module
- steamship.agents.schema.tool module
- Module contents
Action
Agent
AgentContext
ChatAgent
ChatHistory
ChatHistory.append_agent_message()
ChatHistory.append_assistant_message()
ChatHistory.append_llm_message()
ChatHistory.append_message_with_role()
ChatHistory.append_request_complete_message()
ChatHistory.append_status_message_with_role()
ChatHistory.append_system_message()
ChatHistory.append_tool_message()
ChatHistory.append_user_message()
ChatHistory.clear()
ChatHistory.client
ChatHistory.delete_messages()
ChatHistory.embedding_index
ChatHistory.file
ChatHistory.get_or_create()
ChatHistory.initial_system_prompt
ChatHistory.is_searchable()
ChatHistory.last_agent_message
ChatHistory.last_system_message
ChatHistory.last_user_message
ChatHistory.messages
ChatHistory.refresh()
ChatHistory.search()
ChatHistory.select_messages()
ChatHistory.tags
ChatHistory.text_splitter
ChatLLM
FinishAction
LLM
LLMAgent
OutputParser
Tool
- steamship.agents.service package
- Submodules
- steamship.agents.service.agent_service module
AgentService
AgentService.agent
AgentService.async_prompt()
AgentService.build_default_context()
AgentService.get_default_agent()
AgentService.max_actions_per_run
AgentService.max_actions_per_tool
AgentService.next_action()
AgentService.prompt()
AgentService.run_action()
AgentService.run_agent()
AgentService.set_default_agent()
AgentService.use_action_cache
AgentService.use_llm_cache
build_context_appending_emit_func()
- Module contents
- steamship.agents.tools package
- Subpackages
- steamship.agents.tools.audio_transcription package
- steamship.agents.tools.classification package
- steamship.agents.tools.conversation_starters package
- steamship.agents.tools.image_generation package
- steamship.agents.tools.question_answering package
- Submodules
- steamship.agents.tools.question_answering.prompt_database_question_answerer module
- steamship.agents.tools.question_answering.vector_search_learner_tool module
- steamship.agents.tools.question_answering.vector_search_qa_tool module
- steamship.agents.tools.question_answering.vector_search_tool module
- Module contents
- steamship.agents.tools.search package
- steamship.agents.tools.speech_generation package
- steamship.agents.tools.text_generation package
- Submodules
- steamship.agents.tools.text_generation.custom_llm_prompt module
- steamship.agents.tools.text_generation.image_prompt_generator_tool module
- steamship.agents.tools.text_generation.json_object_generator module
- steamship.agents.tools.text_generation.personality_tool module
- steamship.agents.tools.text_generation.summarize_text_with_prompt_tool module
- steamship.agents.tools.text_generation.text_rewrite_tool module
- steamship.agents.tools.text_generation.text_translation_tool module
- Module contents
- steamship.agents.tools.video_generation package
- Submodules
- steamship.agents.tools.base_tools module
- Module contents
AudioBlockifierTool
AudioGeneratorTool
AudioGeneratorTool.accept_output_block()
AudioGeneratorTool.agent_description
AudioGeneratorTool.cacheable
AudioGeneratorTool.generator_plugin_config
AudioGeneratorTool.generator_plugin_handle
AudioGeneratorTool.generator_plugin_instance_handle
AudioGeneratorTool.human_description
AudioGeneratorTool.is_final
AudioGeneratorTool.make_output_public
AudioGeneratorTool.merge_blocks
AudioGeneratorTool.name
GeneratorTool
GeneratorTool.accept_output_block()
GeneratorTool.agent_description
GeneratorTool.cacheable
GeneratorTool.generator_plugin_config
GeneratorTool.generator_plugin_handle
GeneratorTool.generator_plugin_instance_handle
GeneratorTool.human_description
GeneratorTool.is_final
GeneratorTool.make_output_public
GeneratorTool.merge_blocks
GeneratorTool.name
GeneratorTool.post_process()
GeneratorTool.run()
ImageBlockifierTool
ImageGeneratorTool
ImageGeneratorTool.accept_output_block()
ImageGeneratorTool.agent_description
ImageGeneratorTool.cacheable
ImageGeneratorTool.generator_plugin_config
ImageGeneratorTool.generator_plugin_handle
ImageGeneratorTool.generator_plugin_instance_handle
ImageGeneratorTool.human_description
ImageGeneratorTool.is_final
ImageGeneratorTool.make_output_public
ImageGeneratorTool.merge_blocks
ImageGeneratorTool.name
ScrapeAndBlockifyTool
ScrapeAndBlockifyTool.agent_description
ScrapeAndBlockifyTool.blockifier_plugin_config
ScrapeAndBlockifyTool.blockifier_plugin_handle
ScrapeAndBlockifyTool.blockifier_plugin_instance_handle
ScrapeAndBlockifyTool.cacheable
ScrapeAndBlockifyTool.get_mime_type()
ScrapeAndBlockifyTool.human_description
ScrapeAndBlockifyTool.is_final
ScrapeAndBlockifyTool.name
ScrapeAndBlockifyTool.post_process()
ScrapeAndBlockifyTool.run()
ScrapeAndBlockifyTool.should_blockify()
VideoGeneratorTool
VideoGeneratorTool.accept_output_block()
VideoGeneratorTool.agent_description
VideoGeneratorTool.cacheable
VideoGeneratorTool.generator_plugin_config
VideoGeneratorTool.generator_plugin_handle
VideoGeneratorTool.generator_plugin_instance_handle
VideoGeneratorTool.human_description
VideoGeneratorTool.is_final
VideoGeneratorTool.make_output_public
VideoGeneratorTool.merge_blocks
VideoGeneratorTool.name
- Subpackages
Submodules#
steamship.agents.basic_chat module#
steamship.agents.functions_based module#
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'#
- LLM = 'llm'#
- LLM_NAME = 'llm_name'#
- MESSAGE = 'message'#
- MESSAGE_AUTHOR = 'message_author'#
- MESSAGE_TYPE = 'agent_message_type'#
- OBSERVATION = 'observation'#
- PROMPT = 'prompt'#
- SYSTEM = 'system'#
- THOUGHT = 'thought'#
- TOOL = 'tool'#
- TOOL_NAME = 'tool_name'#
- USER = 'user'#
- class steamship.agents.logging.StreamingOpts(*, include_agent_messages: bool = True, include_llm_messages: bool = True, include_tool_messages: bool = True)[source]#
Bases:
BaseModel
Controls what status messages for a given AgentService invocation should be included in the resultant stream.
- include_agent_messages: bool#
Whether or not to include agent-generated messages in the ChatHistory stream.
Agent messages are any logging messages with: AgentLogging.MESSAGE_AUTHOR == AgentLogging.AGENT. These typically are status messages logged in either the AgentService or the Agent code.
NOTE: Agent status messages include “request complete” signal messages for streaming use cases. Disabling these messages will impact streaming generator function.
- include_llm_messages: bool#
Whether or not to include LLM-generated messages in the ChatHistory stream.
LLM messages are any logging messages with: AgentLogging.MESSAGE_AUTHOR == AgentLogging.LLM. These typically are status messages logged in LLM code (ex: ChatOpenAI).
- include_tool_messages: bool#
Whether or not to include Tool-generated messages in the ChatHistory stream.
LLM messages are any logging messages with: AgentLogging.MESSAGE_AUTHOR == AgentLogging.TOOL. These typically are status messages logged in Tool code (ex: GeneratorTool).
- property stream_intermediate_events#
steamship.agents.utils module#
- steamship.agents.utils.build_chat_history(default_system_message: str, message_selector: MessageSelector, context: AgentContext) List[Block] [source]#
- steamship.agents.utils.get_llm(context: AgentContext, default: LLM | None = None) LLM | None [source]#
Retrieves the LLM from the provided AgentContext (if it exists).
- steamship.agents.utils.with_llm(llm: LLM, context: AgentContext | None = None) AgentContext [source]#
Sets an LLM for general purpose lookup and usage on an AgentContext.