Send a list of messages to the agent.
(
self,
actor: User,
agent_id: str,
input_messages: List[MessageCreate],
wrap_user_message: bool = True,
wrap_system_message: bool = True,
interface: Union[AgentInterface, ChatCompletionsStreamingInterface, None] = None, # needed for responses
metadata: Optional[dict] = None, # Pass through metadata to interface
put_inner_thoughts_first: bool = True,
)
| 643 | return self._step(actor=actor, agent_id=agent_id, input_messages=message) |
| 644 | |
| 645 | def send_messages( |
| 646 | self, |
| 647 | actor: User, |
| 648 | agent_id: str, |
| 649 | input_messages: List[MessageCreate], |
| 650 | wrap_user_message: bool = True, |
| 651 | wrap_system_message: bool = True, |
| 652 | interface: Union[AgentInterface, ChatCompletionsStreamingInterface, None] = None, # needed for responses |
| 653 | metadata: Optional[dict] = None, # Pass through metadata to interface |
| 654 | put_inner_thoughts_first: bool = True, |
| 655 | ) -> LettaUsageStatistics: |
| 656 | """Send a list of messages to the agent.""" |
| 657 | |
| 658 | # Store metadata in interface if provided |
| 659 | if metadata and hasattr(interface, "metadata"): |
| 660 | interface.metadata = metadata |
| 661 | |
| 662 | # Run the agent state forward |
| 663 | return self._step( |
| 664 | actor=actor, |
| 665 | agent_id=agent_id, |
| 666 | input_messages=input_messages, |
| 667 | interface=interface, |
| 668 | put_inner_thoughts_first=put_inner_thoughts_first, |
| 669 | ) |
| 670 | |
| 671 | # @LockingServer.agent_lock_decorator |
| 672 | def run_command(self, user_id: str, agent_id: str, command: str) -> LettaUsageStatistics: |