Перейти к содержимому

Muse in Code

Nik Bear Brown

0:00 / 0:00

Muse in Code

18 просмотров · 2 нед. назад
Nik Bear Brown
855 подписчиков
18 просмотров · 2 нед. назад
Muse in Code How to call Muse from your own code: the key, the address and the model name, three ways in (a raw web request, the OpenAI SDK, the Anthropic SDK), instructions and limits, and what to do when a call fails. You come away able to assemble a working call, to tell which base URL goes with which SDK, to read the error JSON and know what 401, 404, 429 and 5xx mean, and to decide when a plain web request is enough. Honest about how it was made: this film was drafted in Muse and then cleaned up and rebuilt with Claude. The film corrects a common misreading: the OpenAI SDK base URL includes /v1 (https://api.meta.ai/v1) while the Anthropic SDK takes the bare host. It shows Meta's own steps for creating a key, notes the Anthropic SDK's auth_token and required max_tokens, and says retry on 429, 500 and 503 but stream instead of retrying a 504. The view that plain web requests are enough is the lecture's own judgment, not attributed to anyone else. A note that opens the film Muse drafted this, Claude cleaned it up. This film began as a rough draft made with Muse. Muse runs on a simple model called Spark, and Spark makes a lot of mistakes, so Claude cleaned the draft up. The method is the point: draft in Muse, then finish in Claude or Codex. One kind of mistake we looked for: a draft Muse diagram of two big boxes and a check mark under a question about whether a non-technical person could use it, with both boxes empty. A diagram that shows nothing teaches nothing, so Claude replaced diagrams like this one. Narrated by Liam, in for Bear. Narration is an AI voice; the film was made with AI tools. Chapters 0:00 Muse note 0:28 The idea and the key terms 0:59 The Key 1:34 The Address 2:27 Three Ways In 3:25 Instructions And Limits 4:11 When It Breaks 5:14 The Stance 6:01 Recap 6:32 Your Turn Your turn Paste this into Claude: Write the smallest Python script that sends one question to Meta's Muse Spark through the OpenAI SDK. Read my key from an environment variable, never from the file itself. Tell me which base URL and model name you used, and explain what an HTTP 401 and an HTTP 404 from this API mean. Then check two things yourself. Does the script read the key from the environment? And does the base URL it used match the one in Meta's docs? Sources shown on screen Meta's public docs at dev.meta.ai (overview, quickstart, authentication, protocols, SDKs, API reference, error handling, models, pricing and rate limits, cookbook), captured 2026-10-07. Narration follows a Muse course taught by Andrew Brown, named on screen. Nothing here is a product endorsement. Part of the playlist Muse for Educational AI. @NikBearBrown #MuseForEducationalAI #AgenticAI #ArtificialIntelligence #ConductingAI #NikBearBrown