Building a Simple Chatbot With Python or Bubble

Matthew Berman walks through a historical OpenAI API demo using Colab and Gradio, then a Bubble no-code workflow.

MBMatthew Berman연사 · Forward Future
채널
Matthew Berman
게시일
2023년 3월 8일
영상
14:55
읽기
2분
슬라이드
3
원문
영어
YouTube에서 열기
스크롤하면 영상이 오른쪽 아래로 작아져 계속 재생됩니다. 자막은 읽기 언어를 따릅니다.
읽기 언어2개 언어로 읽을 수 있음
이 글은 아직 한국어 번역이 없어 영어 원문으로 표시합니다.
요약

30초 요약

Matthew Berman demonstrates two basic chatbot interfaces: a Python notebook using Gradio and a Bubble app using an API connector. The video uses older API and SDK conventions, so readers should check current documentation and protect their API credentials.

  1. 1Python setupA Colab notebook installs the OpenAI and Gradio libraries.
  2. 2Request and responseThe example sends a user message and extracts the returned message content.
  3. 3No-code connectorBubble’s API Connector provides a POST action with private authentication.
  4. 4Workflow and displayThe button sends the input, stores the response and displays it in a text element.

핵심 정리

  1. The Python example wraps an API call in a Gradio text interface.
  2. The Bubble example connects a button workflow to an API action and a response display.
  3. The original tutorial uses historical model names and SDK syntax that may need updating.
  4. API keys must remain private and should not be embedded in shared notebooks or client-side code.
  5. The demo is a basic prompt-and-response interface rather than a full conversation-history implementation.
전문

챕터별로 다듬은 전문 읽기

원본 자막만 보기
01

Python and Gradio

Berman sets up a notebook and wraps a chat-completion call in a simple interface. The demonstration uses historical API syntax.

I demonstrate two ways to build a simple chatbot using the OpenAI API: a Python notebook with Gradio and a no-code interface in Bubble. This is a historical tutorial using the API and libraries available at the time; current interfaces, model names and SDK syntax may differ.

For the Python example I use an OpenAI API key and a Google account for Colab. I create a notebook and install the OpenAI and Gradio libraries. Colab runs notebook cells and makes it easy to experiment without setting up a local Python environment.

The example imports the libraries and configures API access, then defines a function that sends the user’s prompt to the chat-completion endpoint. The demonstrated model is GPT-3.5 Turbo. API credentials should be kept secret rather than embedded in shared notebooks or client-side code.

The request contains a messages array with a user role and the entered text. I explain that a system message can provide general instructions for the assistant, while the user message contains the prompt. The response contains choices, from which the example extracts the returned message text.

I create a Gradio interface around the function with text input and output, then launch it in Colab. A test prompt asking for a joke returns a response. This is a simple prompt-and-response demonstration; the video does not build a persistent conversation history.

02

Bubble API connector

He creates a no-code app and configures an authenticated JSON API action. Credentials must remain private.

The second approach uses Bubble. I create an app, install its API Connector plugin and configure a private authorization header, a JSON content type and a POST action for the chat-completion endpoint. Credentials need to stay private and server-side when an app is shared.

The request body specifies the model and a user message, with a dynamic value for the prompt. I initialize the call using an example prompt so Bubble can inspect the response structure. This tutorial uses the endpoint and settings shown in the video, which may require updates with newer versions.

03

Page and workflow

He adds input, button and response elements, then binds the workflow to the returned message. A preview tests short and longer prompts.

In Bubble’s design view I add a multiline input, a submit button and a text element to display the answer. The goal is a functional interface: the appearance can be customized later.

Bubble input element
슬라이드 1 / 3Bubble input elementThe design view shows a multiline input for the user’s prompt.

The button workflow calls the API action and supplies the input field’s value. A second workflow step stores the first returned message’s content in a custom state on the response element. The display element is then bound to that state.

Storing the API result
슬라이드 2 / 3Storing the API resultThe workflow selects a returned choice and stores it in a custom state.
Chatbot preview
슬라이드 3 / 3Chatbot previewThe simple page contains a prompt box and submit button.

In preview, I submit a prompt asking for a name and receive responses. A longer answer is initially clipped, so I enlarge the text element and test again. Both approaches demonstrate how a user interface can send a prompt and display the API response.

같은 채널의 다른 글

슬라이드 6장25:50EN
MBMatthew Berman· 2026년 10월 24일Kimi K3.1 Pro Tested: Strong 3D Demos, Uneven Results and Competitive PricingMatthew Berman · Forward FutureMatthew Berman tests the open-weight model on coding, 3D rendering and visual explanations, then compares benchmark results and prices.Open-weight modelsBenchmarksAI cost & performance+1
슬라이드 2장32:20EN
MBMatthew Berman· 2026년 10월 23일Who Is Local AI For? The Costs, Trade-offs and a Hybrid FutureMatthew Berman · Forward FutureMatthew Berman weighs data control and independence against hardware cost, setup complexity and inference speed.Local inferenceOpen-weight modelsAI cost & performance+1
45:08EN
MBMatthew Berman· 2026년 10월 21일Sam Altman on AI Discovery, Consciousness, Compute and a Human-Centered FutureMatthew Berman, Sam Altman · Forward FutureIn a conversation with Matthew Berman, Altman discusses scientific progress, personal assistants, recursive self-improvement and the importance of human agency.AI for sciencePersonal agentsConsciousness+2
0:32EN
MBMatthew Berman· 2026년 10월 21일Sam Altman on the Continuing Demand for Software WorkSam Altman, Matthew Berman · OpenAIIn a short interview excerpt, Altman says demand for software may be larger than expected even as AI changes how it is made.Future of WorkSoftware engineering코딩 에이전트
슬라이드 5장12:14EN
MBMatthew Berman· 2026년 10월 14일Gemini 4 Argon Tested: 3D Demos, a Spreadsheet Prototype and Benchmark ResultsMatthew Berman · Forward FutureMatthew Berman tests Google’s model on games and visual projects, then compares reported coding and agent benchmarks.GeminiBenchmarks코딩 에이전트+1
슬라이드 5장10:36EN
MBMatthew Berman· 2026년 10월 13일Meta Muse Wonder Tested: Strong Benchmarks, Mixed Demos and Quota FrictionMatthew Berman · Forward FutureMatthew Berman tests Meta’s models on browser demos and reviews their published benchmark scores, availability and cost.모델과 학습BenchmarksAI cost & performance+1