Meta tags:
description= Connect your Python agent to Slack, web chat, and other platforms over gRPC;
Headings (most frequently used words):
messaging, sdk, the, platform, python, install, connect, to, sidecar, conversation, stream, inbound, message, anatomy, sending, response, receiving, feedback, audio, auxiliary, rpcs, reconnection, local, development, worked, examples, exported, symbols, streaming, text, content, status, updates, suggested, prompts, errors, thread, metadata, transcript, slack, web, playground, browser, chat, cross, agent, node, adapters, overview,
Text of the page (most frequently used words):
the (94), string (69), type (62), message (43), content (43), #platform (39), yes (36), agent (36), contentchunk (34), conversation_id (33), agentresponse (31), notes (31), field (29), user (28), resp (28), for (24), messaging (23), feedback (23), thread (22), cid (22), grpc (22), audio (21), text (21), slack (20), status (19), required (19), statusupdate (18), send (18), payload (18), your (18), queue (17), channel (17), with (16), and (16), from (16), when (16), sidecar (16), import (15), sdk (13), web (13), true (13), outbound (13), start (12), incoming_message (12), stub (12), end (12), timestamp (12), bool (12), suggestedprompts (11), conversationrequest (11), only (11), title (11), transcript (10), adapter (10), stream (10), python (10), protobuf (10), etc (10), below (10), this (9), proto (9), response (9), platformfeedback (9), agentmessagingstub (9), platformcontext (9), astropods_messaging (9), requests (9), def (9), value (9), messages (8), cfg (8), bytes (8), chat (8), card (8), reply (8), raw (8), google (8), enum (8), adapters (7), attachment (7), specific (7), you (7), stt (7), token (7), one (7), attachments (7), button (7), reaction (7), prompt (7), prompts (7), bot (7), see (7), astropods (7), first (7), inbound (7), use (7), custom (7), url (7), discord (7), any (7), not (6), node (6), was (6), page (6), astro (6), audiochunk (6), audiostreamconfig (6), session (6), audio_config (6), processconversation (6), localhost (6), 9090 (6), browser (6), deploy (6), cardattachment (6), hasfield (6), that (6), via (6), level (6), conversation (6), server (6), same (6), error (6), variant (6), knowledge (6), full (5), errorresponse (5), event_kind (5), code (5), encoding (5), data (5), audio_chunk (5), get (5), agent_response (5), event (5), added (5), dev (5), spec (5), statuscode (5), history (5), repeated (5), message_id (5), int32 (5), access (5), emoji (5), variants (5), connect (5), install (5), 2026 (4), overview (4), next (4), previous (4), source (4), audioencoding (4), messageoptions (4), event_kind_app_mention (4), open (4), playground (4), audio_buffers (4), audio_configs (4), done (4), example (4), elif (4), threading (4), whichoneof (4), yield (4), while (4), delta (4), put (4), insecure_channel (4), event_kind_dm (4), json (4), responseattachment (4), fields (4), action (4), response_id (4), thinking (4), updates (4), inside (4), interfaces (4), delay (4), time (4), retry (4), threadhistoryrequest (4), deleted (4), edit (4), edits (4), sent (4), after (4), default (4), streaming (4), native (4), opus (4), new (4), update (4), description (4), back (4), display (4), stores (4), managing (4), agents (4), cli (4), service (3), messagedelete (3), messageedit (3), streamcontrol (3), promptselection (3), buttonclick (3), textfeedback (3), messagereaction (3), threadmetadata (3), responses (3), open_thread (3), platform_context (3), single (3), whether (3), cross (3), emits (3), mediarecorder (3), handle_web_message (3), sample_rate (3), chunk (3), per (3), target (3), stream_llm (3), are (3), 4837 (3), view (3), block (3), kit (3), kind (3), listen (3), return (3), event_kind_observed (3), suggested (3), assistant (3), events (3), without (3), project (3), random (3), internal (3), attempt (3), rpcs (3), original_content (3), max_messages (3), extras (3), map (3), before (3), edited (3), false (3), echoes (3), request (3), include (3), how (3), shape (3), empty (3), identity (3), language (3), placeholder (3), original (3), available (3), click (3), own (3), oneof (3), set (3), existing (3), metadata (3), api (3), should (3), errors (3), custom_message (3), link (3), filename (3), file (3), image (3), chunks (3), ask (3), itself (3), images (3), incoming (3), other (3), changelog (3), reference (3), all (2), policy (2), built (2), config (2), agentconfig (2), exported (2), symbols (2), rest (2), loop (2), identical (2), create_thread (2), options (2), response_pb2 (2), bundled (2), khz (2), firefox (2), ogg_opus (2), webm_opus (2), pop (2), bytearray (2), args (2), generating (2), str (2), dict (2), every (2), two (2), button_id (2), view_logs (2), button_click (2), logs (2), block_kit (2), platform_card_json (2), plain_text (2), actions (2), mrkdwn (2), handle_slack_message (2), more (2), show (2), translate (2), ships (2), threads (2), interactive (2), event_kind_reaction (2), being (2), mentioned (2), event_kind_thread_reply (2), direct (2), worked (2), examples (2), package (2), runs (2), locally (2), flow (2), production (2), under (2), yml (2), ast (2), local (2), development (2), min (2), raise (2), resource_exhausted (2), deadline_exceeded (2), unavailable (2), max_attempts (2), rpcerror (2), requests_factory (2), generated (2), common (2), reconnection (2), was_edited (2), is_deleted (2), getthreadhistory (2), platform_data (2), deleted_at (2), has (2), been (2), last (2), edited_at (2), current (2), threadmessage (2), recent (2), many (2), version (2), must (2), rpc (2), auxiliary (2), aac (2), flac (2), uploads (2), mp3 (2), pre (2), low (2), twilio (2), telephony (2), linear16 (2), int64 (2), user_id (2), bcp (2), speech (2), channels (2), result (2), rate (2), system (2), stream_control (2), label (2), shown (2), free (2), form (2), happened (2), regenerate (2), resume (2), pause (2), stop (2), identifier (2), removed (2), custom_emoji (2), their (2), clicked (2), prompt_selection (2), receiving (2), replace (2), create (2), thread_id (2), tool (2), execution (2), llm (2), limit (2), fallback (2), meaning (2), errorcode (2), details (2), mag (2), base (2), send_response (2), searching (2), search (2), teams (2), size_bytes (2), mime_type (2), height (2), width (2), ship (2), append (2), may (2), chunktype (2), returned (2), pass (2), stable (2), sending (2), forward (2), mention (2), eventkind (2), sender (2), workspace (2), name (2), root (2), top (2), video (2), videos (2), email (2), always (2), anatomy (2), upstream (2), relayed (2), rare (2), generator (2), bidirectional (2), pushes (2), talks (2), pod (2), framework (2), langchain (2), container (2), over (2), markdown (2), guides (2), website (2), join (2), june (2), allowlist (2), egress (2), ips (2), known (2), integrations (2), mastra (2), manually (2), authorize (2), oauth (2), protected (2), mcp (2), servers (2), serve (2), frontend (2), store (2), sqlite (2), using (2), gateway (2), secrets (2), working (2), accounts (2), authentication (2), blueprint (2), welcome (2), docs (2), documentation (2), index (2), llms (2), txt (2), postman, rights, reserved, cookie, preferences, sell, share, personal, information, privacy, terms, helpful, lives, modules, agenttoolconfig, healthcheckresponse, healthcheckrequest, none, else, practice, serves, both, branch, pick, right, filetype, run_stt, extend, iter, maintain, mapping, real, apps, object, arrives, concerns, tab, scoped, conversations, input, clicks, dumps, action_id, elements, east, region, white_check_mark, green, section, header, blocks, record_feedback, can, explain, deeper, message_pb2, straight, through, setsuggestedprompts, setstatus, _assistant_thread_started, _slash_command, _button_click, observing, already, forwards, five, flavours, drive, touching, schema, http, 8080, enable, sleep, except, clean, try, stream_with_retry, establishes, exponential, backoff, wrapper, applied, service_config, there, implement, reconnect, usual, shapes, service_pb2, deletion, author, snapshot, taken, fetched_at, truncated, is_complete, threadhistoryresponse, markers, include_deleted, include_edited, query, returns, plus, unhealthy, degraded, healthy, healthcheck, dedicated, processaudiostream, look, fetching, getconversationmetadata, pull, state, handles, deletions, shot, processmessage, ios, recording, lossless, high, quality, ogg, webm, batch, recorded, frames, latency, codec, 711, law, mulaw, pcm, signed, bit, universal, baseline, audio_encoding_unspecified, segment, run, now, monotonic, ordering, counter, sequence, speaking, origin, upload, mobile, vonage, links, hint, mono, stereo, 8000, 16000, 48000, values, replaces, marks, utterance, format, sample, direction, step, flows, side, does, transcoding, vad, cancel_generation, log_feedback, above, textbox, typed, delete, new_content, why, reason, action_unspecified, prompt_message, matches, prompt_id, populated, thumbs_down, thumbs_up, reaction_type_unspecified, modal, message_delete, message_edit, asked, entry, thumbs, down, who, submitted, anonymous, occurred, which, relates, belongs, sends, interacts, detected, transcribed, create_new, subject, platform_error, failed, tool_error, agent_error, malformed, invalid_request, context, exceeds, context_too_long, hit, rate_limit, avoid, error_code_unspecified, offer, affordance, retryable, technical, logged, facing, tooltip, help, chip, unique, echoed, max, depending, querying, analysis, analyzing, processing, generation, progress, rag, generic, status_unspecified, otherwise, overrides, phrasing, image_url, linkpreview, embeds, cards, fileattachment, alt_text, imageattachment, attachment_type, suppress, notification, silent, reply_to_message_id, visible, recipient, ephemeral, overwrite, post, finalize, optional, here, want, immediate, presence, initial, creation, flags, later, platform_message_id, standalone, semantics, depend, hydrate, context_request, surface, its, thread_metadata, quick, suggestions, actual, streamed, typing, indicator, exactly, used, match, opened, event_kind_assistant_thread_started, slash, command, event_kind_slash_command, event_kind_button_click, observe, private, appear, traffic, event_kind_unspecified, snowflake, activity, resolution, bot_user_id, guild, workspace_id, channel_name, parent, thread_root_id, also, whose, room, channel_id, type_unspecified, rich, mime, size, authenticated, download, role, user_data, avatar, avatar_url, handle, username, correlation, across, lifecycle, echo, files, previews, cleaned, strip, forwarding, ids, received, uuid, assigned, applies, came, main, path, announce, capabilities, startup, agent_config, relay, fabricate, originated, payloads, switch, read, matching, individual, checks, said, bidi, symmetric, iterate, pattern, uses, push, anywhere, program, grpcio, primary, plaintext, loopback, interface, tls, auth, trust, boundary, listens, port, address, pip, names, snake_case, bindings, expose, requires, stubs, building, supported, prefer, higher, reach, directly, implementing, exists, covers, typescript, declare, deploys, alongside, normalises, into, routes, copy, question, platforms, scroll, light, claude, frameworks, monitor, started,
Text of the page (random words):
pe below content string no semantics depend on type attachments repeated responseattachment no ship with end chunks or standalone platform_message_id string no returned by the adapter after start pass on later chunks to update it options messageoptions no creation flags contentchunk chunktype access via contentchunk start etc value use start 1 create the platform message may be empty immediate presence or include initial content delta 2 append the next token s stream as many as you want end 3 finalize last content optional and any attachments ship here replace 4 overwrite the full content for post stream edits messageoptions field type required notes ephemeral bool no only visible to the recipient user create_thread bool no start a new thread under the user s message reply_to_message_id string no reply to a specific message silent bool no suppress notification responseattachment oneof attachment_type variant type fields image imageattachment url alt_text title width height file fileattachment url filename mime_type size_bytes card cardattachment platform_card_json slack block kit discord embeds teams cards link linkpreview url title description image_url example 1 def send payload 2 outbound put conversationrequest agent_response agentresponse 3 conversation_id cid 4 content payload 5 6 7 send contentchunk type contentchunk start content 8 for token in stream_llm prompt 9 send contentchunk type contentchunk delta content token 10 send contentchunk type contentchunk end content status updates statusupdate field type required notes status enum yes see statusupdate status below custom_message string no required with custom otherwise overrides default phrasing emoji string no platform emoji e g mag statusupdate status access via statusupdate thinking etc value meaning status_unspecified 0 do not use thinking 1 generic thinking searching 2 rag knowledge base search generating 3 llm generation in progress processing 4 tool execution analyzing 5 data analysis custom 10 use with custom_message 1 from astropods_messaging import statusupdate 2 3 send_response agentresponse 4 conversation_id cid 5 status statusupdate status statusupdate searching 6 7 send_response agentresponse 8 conversation_id cid 9 status statusupdate 10 status statusupdate custom 11 custom_message querying the knowledge base 12 emoji mag 13 14 suggested prompts suggestedprompts field type required notes prompts repeated suggestedprompts prompt yes max 4 6 depending on platform suggestedprompts prompt field type required notes id string yes unique id echoed back in platformfeedback prompt_selection title string yes button chip label message string yes full message sent on click description string no tooltip help text errors errorresponse field type required notes code enum yes see errorresponse errorcode below message string yes user facing error message details string no technical details logged not shown to the user retryable bool no whether the platform should offer a retry affordance errorresponse errorcode value meaning error_code_unspecified 0 fallback avoid rate_limit 1 agent hit rate limit context_too_long 2 context exceeds llm limit invalid_request 3 malformed request agent_error 4 internal agent error tool_error 5 tool execution failed platform_error 6 platform api error thread metadata threadmetadata field type required notes thread_id string no platform thread id set to update an existing thread title string no thread title subject create_new bool no create a new thread transcript sent after stt to replace the audio placeholder on the platform transcript field type required notes text string yes transcribed text message_id string no placeholder message id to update language string no bcp 47 detected language e g en us receiving platform feedback the sidecar sends platformfeedback on the same stream when the user interacts with a previous response platformfeedback field type required notes conversation_id string yes conversation this feedback belongs to response_id string no which agent response this feedback relates to timestamp google protobuf timestamp yes when the feedback occurred user user no platform user who submitted the feedback empty for anonymous system events one variant yes one of the fields below platformfeedback variants oneof feedback variant type notes reaction messagereaction thumbs up down or custom emoji prompt_selection promptselection user clicked a suggestedprompts entry button_click buttonclick user clicked a button on a cardattachment stream_control streamcontrol user asked to stop pause resume or regenerate message_edit messageedit user edited their own previous message message_delete messagedelete user deleted their own previous message text textfeedback free form text from a platform native modal messagereaction field type required notes type enum yes reaction_type_unspecified thumbs_up thumbs_down custom_emoji emoji string no populated when type custom_emoji added bool yes true added false removed promptselection field type notes prompt_id string matches suggestedprompts prompt id prompt_message string full message being sent buttonclick field type notes button_id string button identifier from card value string button value payload action string action identifier streamcontrol field type notes action enum action_unspecified stop pause resume regenerate reason string why user click error etc messageedit field type notes message_id string platform message id that was edited new_content string new content after edit original_content string original content if available edited_at google protobuf timestamp when the edit happened messagedelete field type notes message_id string platform message id that was deleted deleted_at google protobuf timestamp when the delete happened textfeedback field type notes text string free form text the user typed prompt string label title shown above the textbox 1 for resp in stub processconversation requests 2 if resp hasfield feedback 3 fb resp feedback 4 if fb hasfield reaction 5 log_feedback fb response_id fb reaction type fb reaction added 6 elif fb hasfield stream_control 7 cancel_generation fb conversation_id audio audio flows agent side as raw bytes the messaging system does no stt transcoding or vad step direction message notes 1 sidecar agent agentresponse audio_config format encoding sample rate channels 2 sidecar agent agentresponse audio_chunk raw bytes done true marks end of utterance 3 agent sidecar agentresponse transcript stt result platform replaces the placeholder audiostreamconfig field type required notes encoding enum yes one of the audioencoding values below sample_rate int32 yes hz 8000 telephony 16000 speech 48000 browser channels int32 yes 1 mono speech default 2 stereo language string no bcp 47 hint for stt e g en us conversation_id string yes links audio to a conversation source string no origin browser twilio vonage mobile upload user_id string no speaking user s identity audiochunk field type required notes data bytes yes raw audio bytes empty when done true sequence int64 no monotonic ordering counter done bool no true end of segment run stt now audioencoding access via audioencoding linear16 etc value use audio_encoding_unspecified 0 do not use linear16 1 pcm signed 16 bit le universal baseline mulaw 2 g 711 mu law twilio telephony 8 khz opus 3 raw opus frames low latency codec mp3 4 mp3 batch uploads pre recorded webm_opus 5 webm opus browser mediarecorder default ogg_opus 6 ogg opus firefox mediarecorder flac 7 flac lossless high quality uploads aac 8 aac ios native recording auxiliary rpcs rpc when to use processmessage server streaming for one shot request response same agentresponse shape no inbound feedback getthreadhistory pull current thread state handles edits deletions getconversationmetadata look up a conversation by id or by platform channel thread without fetching history processaudiostream dedicated audio only stream first message must be audiostreamconfig rest are audiochunk s healthcheck returns healthy degraded unhealthy plus the sidecar version threadhistoryrequest field type required default notes conversation_id string yes conversation to query max_messages int32 no 50 how many recent messages to return include_edited bool no true include edit history include_deleted bool no false include deleted markers threadhistoryresponse field type notes conversation_id string echoes the request messages repeated threadmessage recent messages is_complete bool false if truncated by max_messages fetched_at google protobuf timestamp when the snapshot was taken threadmessage field type notes message_id string platform message id user user author content string current content after edits attachments repeated attachment attachments on the message timestamp google protobuf timestamp when it was sent was_edited bool true if the message has been edited original_content string content before edits edited_at google protobuf timestamp last edit time is_deleted bool true if the message has been deleted deleted_at google protobuf timestamp deletion time platform_data map string string platform specific extras 1 from astropods_messaging astro messaging v1 service_pb2 import 2 threadhistoryrequest 3 4 history stub getthreadhistory threadhistoryrequest 5 conversation_id cid max_messages 50 6 7 for m in history messages 8 m content m was_edited m is_deleted m original_content reconnection the python sdk is the raw generated stub there s no built in retry implement reconnect with your usual grpc retry policy two common shapes channel level retry via the grpc service_config json on the channel applied to all rpcs wrapper loop that re establishes the stream on grpc rpcerror with statuscode unavailable deadline_exceeded internal resource_exhausted with exponential backoff 1 import time random grpc 2 3 def stream_with_retry stub requests_factory max_attempts 20 4 delay 0 5 5 attempt 0 6 while true 7 try 8 for resp in stub processconversation requests_factory 9 yield resp 10 return clean end 11 except grpc rpcerror as e 12 attempt 1 13 if attempt max_attempts 14 raise 15 code e code 16 if code not in 17 grpc statuscode unavailable 18 grpc statuscode deadline_exceeded 19 grpc statuscode internal 20 grpc statuscode resource_exhausted 21 22 raise 23 time sleep min delay 30 0 5 random random 0 5 24 delay min delay 2 30 local development ast dev runs the messaging sidecar locally so the sdk flow is identical to production enable platform adapters per project under dev interfaces messaging adapters in astropods yml 1 dev 2 interfaces 3 messaging 4 adapters web or slack web open the bundled playground at http localhost 8080 to drive your agent end to end without touching slack see the package spec for the full dev interfaces messaging schema worked examples slack the slack adapter forwards five flavours of event event_kind source event_kind_dm direct message to the bot event_kind_app_mention bot in a channel or thread event_kind_thread_reply reply inside a thread the bot is already in event_kind_observed channel the bot is observing without being mentioned listen only event_kind_reaction _button_click _slash_command _assistant_thread_started interactive events status updates translate to slack s assistant threads setstatus suggested prompts translate to assistant threads setsuggestedprompts cardattachment ships block kit json straight through 1 import queue threading grpc 2 from astropods_messaging import 3 agentmessagingstub conversationrequest agentresponse 4 contentchunk statusupdate suggestedprompts 5 6 from astropods_messaging astro messaging v1 message_pb2 import platformcontext 7 8 channel grpc insecure_channel localhost 9090 9 stub agentmessagingstub channel 10 outbound queue queue queue queue 11 12 def send resp agentresponse 13 outbound put conversationrequest agent_response resp 14 15 def handle_slack_message m 16 cid m conversation_id 17 kind m platform_context event_kind 18 19 if kind platformcontext event_kind_observed 20 return listen only 21 22 send agentresponse 23 conversation_id cid 24 status statusupdate status statusupdate thinking 25 26 27 open_thread kind platformcontext event_kind_app_mention 28 send agentresponse 29 conversation_id cid 30 content contentchunk type contentchunk start content 31 32 33 for token in stream_llm m content 34 send agentresponse 35 conversation_id cid 36 content contentchunk type contentchunk delta content token 37 38 39 send agentresponse 40 conversation_id cid 41 content contentchunk type contentchunk end content 42 43 44 send agentresponse conversation_id cid prompts suggestedprompts prompts 45 suggestedprompts prompt id p1 title show example 46 message show me an example 47 suggestedprompts prompt id p2 title go deeper 48 message can you explain more 49 50 51 def requests 52 while true 53 yield outbound get 54 55 for resp in stub processconversation requests 56 payload resp whichoneof payload 57 if payload incoming_message and resp incoming_message platform slack 58 threading thread target handle_slack_message 59 args resp incoming_message start 60 elif payload feedback and resp feedback hasfield reaction 61 r resp feedback reaction 62 record_feedback resp feedback response_id r type r added a block kit card with an action button 1 import json 2 from astropods_messaging astro messaging v1 response_pb2 import 3 responseattachment cardattachment 4 5 6 block_kit 7 blocks 8 type header text type plain_text text deploy 4837 9 type section fields 10 type mrkdwn text status n white_check_mark green 11 type mrkdwn text region n us east 1 12 13 type actions elements 14 type button 15 text type plain_text text view logs 16 action_id view_logs value deploy 4837 17 18 19 20 21 send agentresponse 22 conversation_id cid 23 content contentchunk 24 type contentchunk end 25 content deploy status 26 attachments responseattachment 27 card cardattachment platform_card_json json dumps block_kit 28 29 30 when the user clicks view logs you ll get a platformfeedback button_click event with button_id view_logs and value deploy 4837 web playground browser chat every message arrives with platform web and event_kind event_kind_dm the two web specific concerns are audio input and session scoped conversations one conversation_id per browser tab 1 import queue threading grpc 2 from astropods_messaging import 3 agentmessagingstub conversationrequest agentresponse 4 contentchunk statusupdate transcript 5 6 7 channel grpc insecure_channel localhost 9090 8 stub agentmessagingstub channel 9 outbound queue queue queue queue 10 11 audio_buffers dict str bytearray 12 audio_configs dict str object 13 14 def send resp agentresponse 15 outbound put conversationrequest agent_response resp 16 17 def handle_web_message m 18 cid m conversation_id 19 send agentresponse 20 conversation_id cid 21 status statusupdate status statusupdate generating 22 23 send agentresponse 24 conversation_id cid 25 content contentchunk type contentchunk start content 26 27 for token in st...
|