惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Heimdal Security Blog
P
Privacy International News Feed
S
Schneier on Security
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
Spread Privacy
Spread Privacy
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
K
Kaspersky official blog
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
Help Net Security
Help Net Security
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Archives - TechRepublic
Security Archives - TechRepublic
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
N
News and Events Feed by Topic
Hacker News: Ask HN
Hacker News: Ask HN
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
V
V2EX
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
N
News | PayPal Newsroom
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
PCI Perspectives
PCI Perspectives
Google DeepMind News
Google DeepMind News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
U
Unit 42
C
Cybersecurity and Infrastructure Security Agency CISA
P
Palo Alto Networks Blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
博客园 - Franky
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
Y
Y Combinator Blog
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

OpenAI Developers

API deployment checklist | OpenAI API Sora 2 Prompting Guide Codex Prompting Guide Docs MCP | OpenAI Developers Gpt-image-1.5 Prompting Guide GPT-5.2 Prompting Guide Transcribing User Audio with a Separate Realtime Request Modernizing your Codebase with Codex GitHub - openai/openai-sora-sample-app: Sample app to get started using the Video API with Sora GitHub - openai/openai-apps-sdk-examples: Example apps for the Apps SDK GitHub - openai/openai-chatkit-starter-app: Starter app to build with OpenAI ChatKit + Agent Builder Rate limits | OpenAI API Web search | OpenAI API Getting started with datasets | OpenAI API Prompt optimizer | OpenAI API Verifying gpt-oss implementations How to run gpt-oss locally with LM Studio Fine-tuning with gpt-oss and Hugging Face Transformers How to run gpt-oss locally with Ollama Function calling | OpenAI API Models | OpenAI API Reasoning best practices | OpenAI API Reasoning models | OpenAI API Background mode | OpenAI API Batch API | OpenAI API Conversation state | OpenAI API File search | OpenAI API Flex processing | OpenAI API MCP and Connectors | OpenAI API Code Interpreter | OpenAI API Quickstart - OpenAI Agents SDK Build Hour: Agentic Tool Calling Build Hour: Built-In Tools Reasoning best practices | OpenAI API Graders | OpenAI API Evaluation best practices | OpenAI API Working with evals | OpenAI API Guardrails - OpenAI Agents SDK Latency optimization | OpenAI API Optimizing LLM Accuracy | OpenAI API Agent orchestration - OpenAI Agents SDK Production best practices | OpenAI API Realtime transcription | OpenAI API Optimizing LLM Accuracy | OpenAI API Realtime and audio | OpenAI API Realtime conversations | OpenAI API Responses guide Migrate to the Responses API | OpenAI API Speech to text | OpenAI API Supervised fine-tuning | OpenAI API Tracing - OpenAI Agents SDK Vision fine-tuning | OpenAI API Audio and speech | OpenAI API GitHub - openai/openai-cs-agents-demo: Demo of a customer service use case implemented with the OpenAI Agents SDK Voice agents | OpenAI API Fine-tuning best practices | OpenAI API GitHub - openai/openai-agents-python: A lightweight, powerful framework for multi-agent workflows GitHub - openai/openai-agents-js: A lightweight, powerful framework for multi-agent workflows and voice agents Agents SDK | OpenAI API Using tools | OpenAI API Computer use | OpenAI API GitHub - openai/openai-cua-sample-app: Learn how to use CUA (our Computer Using Agent) via the API on multiple computer environments. GitHub - openai/openai-testing-agent-demo: Demo of a UI testing agent using the OpenAI CUA model and the Responses API. Model optimization | OpenAI API GitHub - openai/openai-fm: Code for openai.fm, a demo for the OpenAI Speech API Predicted Outputs | OpenAI API GitHub - openai/openai-realtime-console: React app for inspecting, building and debugging with the Realtime API Building Voice Agents GitHub - openai/openai-realtime-solar-system: Demo showing how to use the OpenAI Realtime API to navigate a 3D scene via tool calling GitHub - openai/openai-realtime-twilio-demo Reinforcement fine-tuning | OpenAI API GitHub - openai/openai-responses-starter-app: Starter app to build with the OpenAI Responses API Structured model outputs | OpenAI API GitHub - openai/openai-structured-outputs-samples: Sample apps to help developers get started with Structured Outputs Voice agents | OpenAI API Model optimization | OpenAI API GitHub - openai/openai-realtime-agents: This is a simple demonstration of more advanced, agentic patterns built on top of the Realtime API. GitHub - openai/openai-support-agent-demo: Demo of a customer support agent interface using NextJS and the OpenAI Responses API with File Search Building Voice Agents Generate images with high input fidelity AI app development: Concept to production Model optimization Building agents Eval Driven System Design - From Prototype to Production Multi-Agent Portfolio Collaboration with OpenAI Agents SDK o3/o4-mini Function Calling Guide Exploring Model Graders for Reinforcement Fine-Tuning Guide to Using the Responses API Reinforcement Fine-Tuning for Conversational Reasoning with the OpenAI API Evals API Use-case - Responses Evaluation Comparing Speech-to-Text Methods with the OpenAI API Generate images with GPT Image Multi-Tool Orchestration with RAG approach using OpenAI Multi-Language One-Way Translation with the Realtime API Doing RAG on PDFs using File Search in the Responses API How to use the Usage API and Cost API to monitor your OpenAI usage Leveraging model distillation to fine-tune a model Orchestrating Agents: Routines and Handoffs Prompt Caching 101 Developing Hallucination Guardrails
GitHub - openai/openai-chatkit-advanced-samples: Starter app to build with OpenAI ChatKit SDK
2025-10-06 · via OpenAI Developers

OpenAI ChatKit Examples

This repository collects scenario-driven ChatKit demos. Each example pairs a FastAPI backend with a Vite + React frontend, implementing a custom backend using ChatKit Python SDK and wiring it up with ChatKit.js client-side.

You can run the following examples:

  • Cat Lounge - caretaker for a virtual cat that helps improve energy, happiness, and cleanliness stats.
  • Customer Support – airline concierge with live itinerary data, timeline syncing, and domain-specific tools.
  • News Guide – Foxhollow Dispatch newsroom assistant with article search, @-mentions, and page-aware responses.
  • Metro Map – chat-driven metro planner with a React Flow network of lines and stations.

Quickstart

  1. Export OPENAI_API_KEY.
  2. Make sure uv is installed.
  3. Launch an example from the repo root, or with npm run start from the project directory:
Example Command for repo root Command for project directory URL
Cat Lounge npm run cat-lounge cd examples/cat-lounge && npm install && npm run start http://localhost:5170
Customer Support npm run customer-support cd examples/customer-support && npm install && npm start http://localhost:5171
News Guide npm run news-guide cd examples/news-guide && npm install && npm run start http://localhost:5172
Metro Map npm run metro-map cd examples/metro-map && npm install && npm run start http://localhost:5173

Feature index

Server tool calls to retrieve application data for inference

  • Cat Lounge:
    • Function tool get_cat_status (cat_agent.py) pulls the latest cat stats for the agent.
  • News Guide:
    • The agent leans on a suite of retrieval tools—list_available_tags_and_keywords, get_article_by_id, search_articles_by_tags/keywords/exact_text, and get_current_page—before responding, and uses show_article_list_widget to present results (news_agent.py).
    • Hidden context such as the featured landing page is normalized into agent input so summaries and recommendations stay grounded (news_agent.py).
  • Metro Map:
    • The metro agent syncs map data with get_map and surfaces line and station details via list_lines, list_stations, get_line_route, and get_station before giving directions (metro_map_agent.py).
    • show_line_selector presents the user a multiple-choice question using a widget.
    • Route-planning replies attach entity sources for the stations in the suggested path as annotations.
  • Customer Support:
    • The concierge prepends a <CUSTOMER_PROFILE> snapshot (itinerary, loyalty, recent timeline) before each run and exposes tools to change seats, cancel trips, add bags, set meals, surface flight options, and request assistance against the per-thread AirlineStateManager state (server.py, support_agent.py, airline_state.py).

Client tool calls that mutate or fetch UI state

  • Metro Map:
    • Client tool get_selected_stations pulls the currently selected nodes from the canvas so the agent can use client-side state in its response (ChatKitPanel.tsx, metro_map_agent.py).

Fire-and-forget client effects

  • Cat Lounge:
    • Client effects update_cat_status and cat_say are invoked by server tools to sync UI state and surface speech bubbles; handled via onEffect in ChatKitPanel.tsx.
  • Metro Map:
    • Client effect location_select_mode is streamed within the server action handler (server.py) after a line is chosen and updates the metro map canvas (ChatKitPanel.tsx).
    • Client effect add_station is streamed by the agent after map updates to immediately sync the canvas and focus the newly created stop (metro_map_agent.py, ChatKitPanel.tsx).
  • Customer Support:
    • The server streams customer_profile/update effects after tools or widget actions so the side panel mirrors the latest itinerary, loyalty, and timeline data (support_agent.py, server.py).

Page-aware model responses

  • News Guide:
    • The ChatKit client forwards the currently open article id in an article-id header so the backend can scope responses to “this page” (ChatKitPanel.tsx).
    • The server reads that request context and exposes get_current_page so the agent can load full content without asking the user to paste it (main.py, news_agent.py).

Progress updates

  • News Guide:
    • Retrieval tools stream ProgressUpdateEvent messages while searching tags, authors, keywords, exact text, or loading the current page so the UI surfaces “Searching…”/“Loading…” states (news_agent.py).
    • The event finder emits progress as it scans dates, days of week, or keywords to keep users informed during longer lookups (event_finder_agent.py).
  • Metro Map:
    • The metro agent emits a progress update while retrieving map information in get_map; it also emits a progress update while waiting for a client tool call to complete in get_selected_stations (metro_map_agent.py).

Response lifecycle UI state

  • Metro Map:
    • The client locks map interaction at response start and unlocks when the stream ends so canvas state doesn’t drift during agent updates by adding onResponseStart and onResponseEnd handlers (ChatKitPanel.tsx).

Widgets without actions

Widgets with actions

  • Cat Lounge:
    • Server tool suggest_cat_names streams a widget with action configs that specify cats.select_name and cats.more_names client-handled actions.
    • When the user clicks the widget, these actions are handled with the handleWidgetAction callback in ChatKitPanel.tsx.
  • Customer Support:
  • News Guide:
  • Metro Map:

Server-handled widget actions

  • Cat Lounge:
    • The cats.select_name action is also handled server-side to reflect updates to data and stream back an updated version of the name suggestions widget in server.py.
    • It is invoked using chatkit.sendAction() from handleWidgetAction callback in ChatKitPanel.tsx.
  • Customer Support:
    • Action handlers persist bookings, meals, upsells, and rebooks; lock widgets; log hidden context; and refresh the profile when users click flight.select, support.set_meal_preference, booking.*, upsell.*, or rebook.select_option (server.py).
  • News Guide:
    • The view_event_details action is processed server-side to update the timeline widget with expanded descriptions without a round trip to the model (server.py).
  • Metro Map:
    • The line.select action is handled server-side to stream an updated widget, add a <LINE_SELECTED> hidden context item to thread, stream an assistant message to ask the user whether to add the station at the line’s start or end, and trigger the location_select_mode client effect for the UI to sync (server.py).

Attachments

  • Customer Support:
    • End-to-end image attachments: the backend issues upload/download URLs, enforces image/size limits, and converts uploads to data URLs for the model (attachment_store.py, main.py, thread_item_converter.py). The React panel registers attachments.create, uploads via the signed URL, and drops the attachment into the composer when travellers share inspiration photos (CustomerContextPanel.tsx).

Dictation (speech-to-text)

  • Customer Support:
    • The chat composer supports built-in dictation (click the mic button to speak). It's enabled client-side via composer.dictation (ChatKitPanel.tsx) and handled server-side by implementing ChatKitServer.transcribe() (server.py).

Annotations

  • Metro Map:
    • The plan_route tool renders each station in a planned route as an entity source on the assistant message. The station is rendered as inline annotations in the assistant message and also in the sources list.
    • The client’s entity click handler pans the React Flow canvas to the clicked station (ChatKitPanel.tsx, metro_map_agent.py).

Thread titles

  • Cat Lounge:
    • After the user names the cat, the set_cat_name tool locks in the name and updates the thread title to {name}’s Lounge before saving it (cat_agent.py).
  • Customer Support:
    • A lightweight title agent names the conversation on the first user message without delaying the first reply (title_agent.py, server.py).
  • News Guide:
    • The title_agent runs on the first user message to generate a short newsroom-friendly title when none exists (server.py, title_agent.py).
  • Metro Map:
    • The metro server uses a dedicated title_agent to set a brief metro-planning title on the first turn and persists it to thread metadata (server.py, title_agent.py).

Entity tags (@-mentions)

  • News Guide:
    • Entity search and previews power @-mentions for articles/authors in the composer (type @ or click the @ button) and render hover previews via /articles/tags (ChatKitPanel.tsx, main.py).
    • Tagged entities are converted into model-readable markers so the agent can fetch the right records (<ARTICLE_REFERENCE> / <AUTHOR_REFERENCE>) (thread_item_converter.py).
    • Article reference tags are resolved into full articles via the instructed get_article_by_id tool before the agent cites details (news_agent.py).
  • Metro Map:
    • The composer’s entity search lists stations so users can @-mention them (type @ or click the @ button); clicking a tag also focuses the station on the canvas (ChatKitPanel.tsx).
    • Tagged stations are converted into <STATION_TAG> blocks with full line metadata so the agent can answer without another lookup (thread_item_converter.py, server.py).

Tool choice (composer menu)

  • News Guide:
    • The ChatKit client is configured with a composer.tools option that specifies options in the composer menu (ChatKitPanel.tsx)
    • Composer tool buttons let users force specific agents (event_finder, puzzle), setting tool_choice on the request (config.ts).
    • The backend routes these tool choices to specialized agents before falling back to the News Guide agent (server.py).

Custom header actions

  • Metro Map:
    • The chat header uses a right-side icon toggle (dark-mode / light-mode) to flip the app’s color scheme client-side (ChatKitPanel.tsx).

Image generation

  • Cat Lounge:
    • The cat_agent includes an ImageGenerationTool configured with 3 partial images.
    • The cat lounge server's respond method passes in ResponseStreamConverter(partial_images=3) when invoking stream_agent_response so that the helper correctly computes image generation progress when streaming each partial image.