If you are not sure if the website you would like to visit is secure, you can verify it here. Enter the website address of the page and see parts of its content and the thumbnail images on this site. None (if any) dangerous scripts on the referenced page will be executed. Additionally, if the selected site contains subpages, you can verify it (review) in batches containing 5 pages.
favicon.ico: docs.astropods.com/adapters/custom-python - Custom adapter (Python) | Astr.

site address: docs.astropods.com/adapters/custom-python

site title: Custom adapter (Python) Astro AI Documentation

Our opinion (on Friday 03 July 2026 20:10:24 UTC):

GREEN status (no comments) - no comments
After content analysis of this website we propose the following hashtags:


page from cache: 7 hours ago
Meta tags:
description=Build a custom adapter with astropods-adapter-core;

Headings (most frequently used words):

adapter, custom, worked, example, python, install, minimal, lifecycle, agentadapter, protocol, serve, options, plain, anthropic, agent, audio, with, stt, rules, of, thumb, exported, symbols, streamhooks, streamoptions, audioinput, voiceprovider, feedbackevent, node, rfc, astropods, spec,

Text of the page (most frequently used words):
the (36), #adapter (20), hooks (20), with (17), your (17), text (15), str (15), from (14), async (14), agent (14), for (13), serve (13), stream (13), audio (13), self (12), custom (11), and (11), options (11), #streamhooks (10), streamoptions (9), def (9), python (8), user (8), call (8), prompt (8), name (8), first (8), you (7), data (7), not (6), astropods (6), import (6), message (6), status (6), on_status_update (6), stream_audio (6), bytes (6), notes (6), spec (5), yes (5), this (5), page (5), sdk (5), audioinput (5), agentadapter (5), framework (5), core (5), return (5), on_feedback (5), on_error (5), on_finish (5), transcript (5), none (5), on_chunk (5), messages (5), anthropic (5), platform (5), feedback (5), protocol (5), install (5), 2026 (4), node (4), helpful (4), platformcontext (4), serveoptions (4), feedbackevent (4), astropods_adapter_core (4), raw (4), use (4), tools (4), system_prompt (4), get_config (4), exception (4), config (4), listen (4), any (4), class (4), worked (4), example (4), stt (4), dict (4), type (4), optional (4), card (4), overview (4), knowledge (4), stores (4), managing (4), agents (4), cli (4), previous (3), see (3), proto (3), messaging (3), exported (3), voiceprovider (3), manually (3), calling (3), adapters (3), memory (3), key (3), conversation_id (3), don (3), block (3), push (3), own (3), except (3), await (3), custom_message (3), try (3), myadapter (3), etc (3), are (3), assistant (3), environ (3), api (3), lifecycle (3), bridge (3), may (3), modal (3), messagereaction (3), reaction (3), kind (3), user_id (3), field (3), method (3), when (3), changelog (3), mastra (3), reference (3), all (2), messagingbridge (2), entry (2), symbols (2), configure (2), does (2), platform_context (2), queue (2), trigger (2), inside (2), per (2), request (2), reply (2), exactly (2), rules (2), thumb (2), run (2), on_transcript (2), _voice (2), processing (2), voice (2), anthropicdirect (2), event (2), content (2), system (2), claude (2), client (2), generating (2), asyncanthropic (2), streaming (2), plain (2), get (2), grpc_server_addr (2), localhost (2), 9090 (2), server_address (2), required (2), handles (2), sigterm (2), sigint (2), start (2), sync (2), their (2), body (2), label (2), emoji (2), thumbs_down (2), thumbs_up (2), source (2), values (2), populated (2), submitter (2), display (2), conversation (2), passed (2), stable (2), then (2), segment (2), contentchunk (2), end (2), after (2), tts (2), audiochunk (2), typing (2), llm (2), these (2), directly (2), grpc (2), minimal (2), markdown (2), ask (2), guides (2), website (2), join (2), discord (2), june (2), allowlist (2), egress (2), ips (2), known (2), integrations (2), langchain (2), authorize (2), requests (2), connect (2), oauth (2), protected (2), mcp (2), servers (2), frontend (2), store (2), sqlite (2), using (2), gateway (2), secrets (2), working (2), accounts (2), authentication (2), deploy (2), blueprint (2), project (2), welcome (2), docs (2), documentation (2), index (2), level (2), llms (2), txt (2), postman, rights, reserved, cookie, preferences, sell, share, personal, information, privacy, policy, terms, service, built, rfc, next, was, underlying, shapes, referenced, points, astropods_messaging, dataclasses, protocols, interfaces, otel, before, want, traces, auto, thread_id, work, catch, exceptions, let, coroutine, raise, sees, nothing, skipping, either, leaves, staring, half, rendered, one, now, were, transcribing, handling, usual, object, __init__, record_feedback_async, evals, pipeline, airtable, text_stream, role, 1024, max_tokens, sonnet, model, direct, astro_gateway_url, base_url, astro_gateway_api_key, api_key, just, defaults, implementation, parameter, thin, wrapper, that, process, sets, json, formatted, logging, runs, exits, asyncio, probes, dispatches, result, slow, write, hasattr, deleted, message_delete, edited, message_edit, stop, pause, resume, regenerate, streamcontrol, stream_control, clicked, suggestedprompts, prompt_selection, cardattachment, buttonclick, button_click, submission, textfeedback, holds, custom_emoji, synthesized, enum, value, user_name, anonymous, events, table, below, targets, response_id, attached, string, discriminator, imports, needed, transcribe, pass, instance, its, encoding, sample_rate, channels, language, audiostreamconfig, accumulated, channel, thread, ids, workspace, event_kind, did, originate, sender, scoping, trace, attribution, across, session, passes, every, fetching, takes, valid, include, analyzing, searching, thinking, response, complete, once, generation, failed, also, errorresponse, marker, done, true, on_audio_end, back, on_audio_chunk, replaces, placeholder, pre, indicator, tool, execution, statusupdate, each, fragment, delta, sends, they, translate, into, outbound, agentresponse, receive, thumbs, down, button, clicks, handle, omit, reject, input, friendly, returns, playground, used, logs, agentconfig, member, interface, duck, typed, members, satisfies, connects, blocks, until, hello, requires, pip, there, party, apis, agnostic, implement, hand, bundled, loop, shutdown, more, actions, view, copy, question, build, scroll, top, light, frameworks, monitor, started, search, available, root, append, url, version, astro,


Text of the page (random words):
custom adapter python astro ai documentation for ai agents a documentation index is available at the root level at llms txt append llms txt to any url for a page level index or md for the markdown version of any page search ask ai join discord website docs cli api reference docs cli api reference get started welcome install the cli your first project your first blueprint deploy your first agent managing your agents authentication platform working with accounts managing secrets ai gateway agent card knowledge stores monitor your agents overview frameworks guides using knowledge stores store data with sqlite serve a frontend from your agent connect to oauth protected mcp servers manually authorize requests messaging sdk adapters overview mastra langchain custom adapter node custom adapter python reference astropods spec agent card spec known integrations allowlist egress ips changelog changelog welcome install the cli your first project your first blueprint deploy your first agent managing your agents authentication working with accounts managing secrets ai gateway agent card knowledge stores overview ai sdk mastra claude agent sdk using knowledge stores store data with sqlite serve a frontend from your agent connect to oauth protected mcp servers manually authorize requests node python overview mastra langchain custom adapter node custom adapter python astropods spec agent card spec known integrations allowlist egress ips changelog june 23 2026 june 10 2026 may 28 2026 join discord website light on this page install minimal adapter lifecycle agentadapter protocol streamhooks streamoptions audioinput voiceprovider feedbackevent serve adapter options worked example a plain anthropic agent worked example audio with stt rules of thumb exported symbols scroll to top guides adapters custom adapter python build a custom adapter with astropods adapter core ask a question copy page view as markdown more actions astropods adapter core is the framework agnostic python core implement the agentadapter protocol hand it to serve and the bundled messagingbridge handles the grpc streaming loop audio feedback and shutdown use this when there s no first party adapter for your framework or no framework at all you re calling llm apis directly install pip install astropods adapter core requires python 3 10 minimal adapter 1 from astropods_adapter_core import streamhooks streamoptions serve 2 3 class myadapter 4 name my agent 5 6 async def stream self prompt str hooks streamhooks options streamoptions none 7 try 8 hooks on_chunk hello 9 hooks on_chunk f prompt 10 hooks on_finish 11 except exception as e 12 hooks on_error e 13 14 def get_config self dict 15 return system_prompt you are a helpful assistant tools 16 17 serve myadapter serve adapter connects to localhost 9090 or grpc_server_addr and blocks until sigint sigterm lifecycle agentadapter protocol the interface is a typing protocol duck typed any class with these members satisfies it member required notes name str yes display name used in logs and agentconfig async stream prompt hooks options yes stream a reply call hooks on_chunk on_status_update etc as you go get_config dict yes returns system_prompt str tools for the playground async stream_audio audio hooks options no handle audio messages omit to reject audio input with a friendly message on_feedback feedback no receive thumbs up down text feedback button clicks etc may be sync or async streamhooks call these from inside stream and stream_audio they translate directly into outbound agentresponse messages on the grpc stream method sends when to call on_chunk text contentchunk start first then delta s each text fragment from the llm on_status_update status statusupdate pre content typing indicator tool execution status on_transcript text transcript after stt replaces the audio placeholder on_audio_chunk data audiochunk tts bytes back to the platform on_audio_end audiochunk done true end of segment marker after tts on_error exception errorresponse generation failed do not also call on_finish on_finish contentchunk end response complete call exactly once per request on_status_update takes a dict with a status key valid values thinking searching generating processing analyzing custom for custom include custom_message 1 hooks on_status_update status custom custom_message fetching data streamoptions the bridge passes this to every stream stream_audio call field type notes conversation_id str stable across the conversation use as the memory session key user_id str sender s user id use for memory scoping and trace attribution platform_context optional platformcontext channel thread ids workspace event_kind raw platform user_id none when the message did not originate from a platform adapter see messaging sdk platformcontext audioinput passed to stream_audio field type notes data bytes raw audio bytes accumulated from the segment config proto audiostreamconfig encoding sample_rate channels language source voiceprovider optional protocol for stt pass an instance to your adapter then call its listen method in stream_audio method notes async listen data bytes config str transcribe raw audio bytes to text feedbackevent passed to on_feedback kind is a stable string discriminator no proto imports needed field type notes conversation_id str conversation the feedback is attached to response_id str platform message id the feedback targets kind str see table below user_id str submitter s user id for anonymous system events user_name str submitter s display name text optional str populated for text the body reaction emoji name prompt optional str populated for text the modal label feedbackevent kind values value source thumbs_up messagereaction with thumbs_up synthesized from the reaction enum thumbs_down messagereaction with thumbs_down reaction messagereaction with custom_emoji text holds the emoji name text textfeedback modal submission text is the body prompt is the modal label button_click buttonclick from a cardattachment prompt_selection user clicked a suggestedprompts entry stream_control streamcontrol stop pause resume regenerate message_edit user edited their own previous message message_delete user deleted their own previous message on_feedback may be sync or async the bridge probes with hasattr and dispatches it does not await the result so don t block on slow i o push to a queue or trigger an async write and return serve adapter options thin wrapper that handles process lifecycle sets up json formatted logging runs asyncio run bridge start and exits on sigint sigterm parameter type required notes adapter agentadapter yes your implementation options serveoptions no serveoptions server_address serveoptions server_address defaults to os environ get grpc_server_addr localhost 9090 worked example a plain anthropic agent no framework just calling anthropic s streaming messages api 1 import os 2 from anthropic import asyncanthropic 3 from astropods_adapter_core import streamhooks streamoptions serve 4 5 client asyncanthropic 6 api_key os environ astro_gateway_api_key 7 base_url os environ astro_gateway_url 8 9 10 class anthropicdirect 11 name anthropic direct 12 13 async def stream self prompt str hooks streamhooks options streamoptions none 14 try 15 hooks on_status_update status generating 16 17 async with client messages stream 18 model claude sonnet 4 6 19 max_tokens 1024 20 system you are a helpful assistant 21 messages role user content prompt 22 as stream 23 async for text in stream text_stream 24 hooks on_chunk text 25 26 hooks on_finish 27 except exception as e 28 hooks on_error e 29 30 def get_config self dict 31 return system_prompt you are a helpful assistant tools 32 33 def on_feedback self event none 34 push to your evals pipeline airtable etc don t block 35 record_feedback_async event 36 37 serve anthropicdirect worked example audio with stt 1 from astropods_adapter_core import audioinput streamhooks streamoptions serve 2 3 class myadapter 4 name my agent 5 6 def __init__ self voice 7 self _voice voice any object with async listen bytes config str 8 9 async def stream self prompt hooks options 10 text handling as usual 11 12 async def stream_audio self audio audioinput hooks streamhooks options streamoptions none 13 try 14 hooks on_status_update status processing custom_message transcribing audio 15 transcript await self _voice listen audio data audio config 16 hooks on_transcript transcript 17 18 now run the agent on the transcript as if it were a text message 19 await self stream transcript hooks options 20 except exception as e 21 hooks on_error e 22 23 def get_config self 24 return system_prompt tools rules of thumb call exactly one of on_finish or on_error per request skipping either leaves the user staring at a half rendered reply catch your own exceptions inside stream if you let the coroutine raise the user sees nothing don t block in on_feedback push to a queue or trigger async work and return use options conversation_id not platform_context thread_id as your memory key configure otel manually before calling serve if you want traces framework adapters auto configure this the raw core does not exported symbols 1 from astropods_adapter_core import 2 protocols interfaces 3 agentadapter 4 streamhooks 5 voiceprovider 6 dataclasses 7 streamoptions 8 audioinput 9 feedbackevent 10 serveoptions 11 re exported from astropods_messaging 12 platformcontext 13 entry points 14 serve 15 messagingbridge 16 see messaging sdk python for the underlying proto shapes referenced by streamhooks and platformcontext was this page helpful yes no previous custom adapter node next rfc 1 astropods spec built with terms of service privacy policy do not sell or share my personal information cookie preferences 2026 postman all rights reserved
Images from subpage: "docs.astropods.com/blueprints" Verify
Images from subpage: "docs.astropods.com/deploy-agent" Verify
Images from subpage: "docs.astropods.com/managing-agents" Verify
Images from subpage: "docs.astropods.com/authentication" Verify
Images from subpage: "docs.astropods.com/accounts" Verify

Verified site has: 38 subpage(s). Do you want to verify them? Verify pages:

1-5 6-10 11-15 16-20 21-25 26-30 31-35 36-38


The site also has references to the 1 subdomain(s)

  astropods.com  Verify


Top 50 hastags from of all verified websites.

Supplementary Information (add-on for SEO geeks)*- See more on header.verify-www.com

Header

HTTP/2 200
age 78401
cache-control public, max-age=0, must-revalidate
content-encoding gzip
content-security-policy default-src self ; script-src self unsafe-inline unsafe-eval htt????/app.buildwithfern.com https: blob:; style-src self unsafe-inline htt????/app.buildwithfern.com https:; img-src self htt????/app.buildwithfern.com https: data: blob:; font-src self htt????/app.buildwithfern.com https: data:; connect-src self htt????/app.buildwithfern.com https: wss: ws: data: blob:; media-src self htt????/app.buildwithfern.com https: data: blob:; object-src self htt????/app.buildwithfern.com https: data: blob:; frame-src self htt????/app.buildwithfern.com https: data: blob:; base-uri self ; form-action self htt????/app.buildwithfern.com https:
content-type text/html; charset=utf-8
date Thu, 02 Jul 2026 15:19:48 GMT
etag W/ 10fvpdshd96lmnm
link </.well-known/api-catalog>; rel= api-catalog
permissions-policy camera=(), geolocation=()
referrer-policy strict-origin-when-cross-origin
server Vercel
strict-transport-security max-age=63072000; includeSubDomains; preload
vary rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch
x-content-type-options nosniff
x-matched-path /[domain]/[mode]/[requiresLogin]/[isLoggedIn]/[roles]/[locale]/[slug]
x-nextjs-prerender 1
x-nextjs-stale-time 300
x-powered-by Next.js
x-vercel-cache HIT
x-vercel-id fra1::iad1::hbb4t-1783083990348-be76eb470d1f

Meta Tags

title="Custom adapter (Python) | Astro AI | Documentation"
charset="utf-8"
name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=5, user-scalable=yes"
name="description" content="Build a custom adapter with astropods-adapter-core"
name="application-name" content="Astro AI | Documentation"
name="generator" content="htt????/buildwithfern.com"
property="og:title" content="Custom adapter (Python) | Astro AI | Documentation"
property="og:description" content="Build a custom adapter with astropods-adapter-core"
property="og:url" content="htt????/docs.astropods.com/adapters/custom-python"
name="twitter:card" content="summary_large_image"
name="twitter:title" content="Custom adapter (Python) | Astro AI | Documentation"
name="twitter:description" content="Build a custom adapter with astropods-adapter-core"
name="fern:rendering-mode" content="production-remote"
name="fern:loader-mode" content="v2"
id="fern-theme-color-preferred-light" name="theme-color" content="#f8fafc" media="(prefers-color-scheme: light)"
id="fern-theme-color-preferred-dark" name="theme-color" content="#020617" media="(prefers-color-scheme: dark)"
id="fern-theme-color" name="theme-color" content="#f8fafc"

Load Info

page size1009237
load time (s)0.545916
redirect count0
speed download192244
server IP 64.239.123.1
* all occurrences of the string "http://" have been changed to "htt???/"