You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Process a user message and return the agent's response.
3856
+
This endpoint accepts a message from a user and processes it through the agent.
3857
+
It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
3858
+
</dd>
3859
+
</dl>
3860
+
</dd>
3861
+
</dl>
3862
+
3863
+
#### 🔌 Usage
3864
+
3865
+
<dl>
3866
+
<dd>
3867
+
3868
+
<dl>
3869
+
<dd>
3870
+
3871
+
```python
3872
+
from letta import Letta, MessageCreate
3873
+
3874
+
client = Letta(
3875
+
token="YOUR_TOKEN",
3876
+
)
3877
+
response = client.agents.stream_message(
3878
+
agent_id="agent_id",
3879
+
messages=[
3880
+
MessageCreate(
3881
+
role="user",
3882
+
text="text",
3883
+
)
3884
+
],
3885
+
)
3886
+
for chunk in response:
3887
+
yield chunk
3888
+
3889
+
```
3890
+
</dd>
3891
+
</dl>
3892
+
</dd>
3893
+
</dl>
3894
+
3895
+
#### ⚙️ Parameters
3896
+
3897
+
<dl>
3898
+
<dd>
3899
+
3900
+
<dl>
3901
+
<dd>
3902
+
3903
+
**agent_id:**`str`
3904
+
3905
+
</dd>
3906
+
</dl>
3907
+
3908
+
<dl>
3909
+
<dd>
3910
+
3911
+
**messages:**`LettaStreamingRequestMessages` — The messages to be sent to the agent.
3912
+
3913
+
</dd>
3914
+
</dl>
3915
+
3916
+
<dl>
3917
+
<dd>
3918
+
3919
+
**assistant_message_tool_name:**`typing.Optional[str]` — The name of the designated message tool.
3920
+
3921
+
</dd>
3922
+
</dl>
3923
+
3924
+
<dl>
3925
+
<dd>
3926
+
3927
+
**assistant_message_tool_kwarg:**`typing.Optional[str]` — The name of the message argument in the designated message tool.
3928
+
3929
+
</dd>
3930
+
</dl>
3931
+
3932
+
<dl>
3933
+
<dd>
3934
+
3935
+
**stream_tokens:**`typing.Optional[bool]` — Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
0 commit comments