Logo: Iblai Api Studio Pdf

Iblai Api Studio Pdf

Organisatioun
iblai
iblai-api-studio-pdf

Add a PDF viewer component to an Open edX unit on Studio — enable the pdf advanced module on the course, upload the PDF as a course asset, create the pdf block, and save its title and href through the block's own save_pdf handler (the generic xblock update does not persist the file field). Use when the user wants a PDF, slides, a syllabus, a reading handout or any document displayed inline in a unit. Session auth via studio.env.

Iwwersiicht

Editeuriblai
Repositoryvibe
Skill-Nummiblai-api-studio-pdf
Stären
229
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    iblai huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Iblai Api Studio Pdf an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-pdf
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iblai/vibe.git /tmp/vibe
mkdir -p .claude/skills
cp -r /tmp/vibe/skills/content/iblai-api-studio-pdf .claude/skills/iblai-api-studio-pdf
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Iblai Api Studio Pdf an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Iblai Api Studio Pdf automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Iblai Api Studio Pdf net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

iblai-api-studio-pdf

The pdf XBlock renders a PDF inline in the unit. It is an advanced module: the course has to list it in advanced_modules before Studio will create one, and it saves its fields through its own handler, not the generic xblock update. Three steps: enable once per course → upload the file → create + save.

Before you start

  1. Preflight: node .claude/skills/iblai-api-studio-auth/scripts/studio-login.mjs --check prints two oks; otherwise run /iblai-api-studio-auth first — do not attempt the calls below.
  2. A unit locator (/iblai-api-studio-unit, or the unit list from /iblai-api-studio-outline — the bulk builder cannot create pdf blocks, so they are always added here afterwards).
  3. The PDF file on disk (compressed if large).

Auth & conventions

  • Base URL: $STUDIO_URL; Studio session cookies from studio.env (its values are single-quoted — bash strips the quotes; any other parser must strip them too, or Studio answers 500: /iblai-api-studio-auth).
  • Snippet:
    bash
    set -a; . ./studio.env; set +a
    S=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
       -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" -H "Content-Type: application/json")
  • Keys: COURSE = course-v1:…; parent = a unit locator; the block is …+type@pdf+block@<hex>.
  • Fields: display_name (title) and href (URL of the PDF — a course asset /static/<file>.pdf or an absolute https:// URL).
  • Draft until the unit is published (/iblai-api-studio-publish). DELETE is destructive — confirm with the user first.

Reads

  • GET /settings/advanced/{COURSE} — { …, "advanced_modules": { "value": ["pdf", …], … } }; the block can be created only when "pdf" is in value.
  • GET /xblock/{pdf} — { "display_name", "category": "pdf", "metadata": { "display_name" }, "published", "has_changes" }. The href is not in metadata; read it from the studio view:
  • GET /xblock/{pdf}/studio_view — { "html": "…<input id=\"edit_href\" … value=\"/static/syllabus.pdf\">…" }; regex id="edit_href"[^>]*value="([^"]*)".
  • GET /assets/{COURSE}/?asset_type=Documents&page_size=50 — uploaded PDFs (assets[].portable_url is the /static/… path to use).

Writes

  1. Enable the module (once per course; keeps the other entries): POST /settings/advanced/{COURSE} { "advanced_modules": { "value": ["pdf"] } } → the full advanced-settings map with the new value. Read first and merge if value already lists other modules.
  2. Upload the PDF (multipart, field file, no JSON content type):
    bash
    curl -s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
      -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" \
      -X POST "$STUDIO_URL/assets/$COURSE/" -F "file=@syllabus.pdf"
    → { "asset": { "display_name": "syllabus.pdf", "content_type": "application/pdf", "url": "/asset-v1:…+type@asset+block@syllabus.pdf", "portable_url": "/static/syllabus.pdf", "external_url": "https://<lms>/asset-v1:…", "id": "asset-v1:…", "locked": false, … }, "msg": "Upload completed" }. Re-uploading the same filename replaces the asset.
  3. Create the block: POST /xblock/ { "parent_locator": "<unit>", "category": "pdf", "display_name": "Syllabus" } → { "locator": "…+type@pdf+block@<hex>", "courseKey" }. 400/500 here usually means step 1 was skipped.
  4. Save title + file: POST /xblock/{pdf}/handler/save_pdf
    json
    { "display_name": "Syllabus", "href": "/static/syllabus.pdf" }
    → { "result": "success" } (or { "result": "error", "message": "…" }). This is the only call that persists href.
  • POST /xblock/{pdf} { "metadata": { "display_name": "New title" } } — rename only. Sending href or url in metadata is silently ignored or returns 500; never use it for the file.
  • DELETE /xblock/{pdf} → 204. Confirm with the user first.

Example

bash
set -a; . ./studio.env; set +a
S=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
   -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" -H "Content-Type: application/json")
COURSE="course-v1:acme+DATA101+2026-T1"
UNIT="block-v1:acme+DATA101+2026-T1+type@vertical+block@645f5ded5f544adab9fb603c4afc3bac"

# 1. enable (merge with existing modules)
MODS=$(curl "${S[@]}" "$STUDIO_URL/settings/advanced/$COURSE" | python3 -c '
import sys,json; v=json.load(sys.stdin)["advanced_modules"]["value"]; print(json.dumps(sorted(set(v)|{"pdf"})))')
curl "${S[@]}" -X POST "$STUDIO_URL/settings/advanced/$COURSE" -d "{\"advanced_modules\":{\"value\":$MODS}}" >/dev/null

# 2. upload (multipart: same cookies/CSRF, no JSON content type)
U=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
   -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json")
STATIC=$(curl "${U[@]}" -X POST "$STUDIO_URL/assets/$COURSE/" -F "file=@syllabus.pdf" \
  | python3 -c 'import sys,json; print(json.load(sys.stdin)["asset"]["portable_url"])')      # /static/syllabus.pdf

# 3 + 4. create and save
PDF=$(curl "${S[@]}" -X POST "$STUDIO_URL/xblock/" -d "{\"parent_locator\":\"$UNIT\",\"category\":\"pdf\",\"display_name\":\"Syllabus\"}" \
  | python3 -c 'import sys,json; print(json.load(sys.stdin)["locator"])')
curl "${S[@]}" -X POST "$STUDIO_URL/xblock/$PDF/handler/save_pdf" -d "{\"display_name\":\"Syllabus\",\"href\":\"$STATIC\"}"

Notes

  • href accepts /static/<name> (course asset, portable across reruns and hosts) or an absolute URL; use assets for anything the org owns. External URLs must allow embedding (no X-Frame-Options: DENY).
  • The viewer is an inline reader; there is no download toggle in this block's fields — link the external_url from an /iblai-api-studio-html block if users need a download link.
  • Verify with studio_view (regex above) after saving; the generic GET /xblock/{pdf} will always show only display_name.
  • The -F upload must not carry Content-Type: application/json; the example uses a second header array without it.
  • Large PDFs: Studio accepts uploads up to the deployment's limit (tens of MB); compress first when in doubt.

Heefeg gestallte Froen

Wat mécht de KI-Skill Iblai Api Studio Pdf?

Add a PDF viewer component to an Open edX unit on Studio — enable the pdf advanced module on the course, upload the PDF as a course asset, create the pdf block, and save its title and href through the block's own save_pdf handler (the generic xblock update does not persist the file field). Use when the user wants a PDF, slides, a syllabus, a reading handout or any document displayed inline in a unit. Session auth via studio.env.

Firwat Iblai Api Studio Pdf op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Iblai Api Studio Pdf besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Iblai Api Studio Pdf an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-pdf an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Iblai Api Studio Pdf benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Iblai Api Studio Pdf benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Iblai Api Studio Pdf domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Iblai Api Studio Pdf gratis?

Jo. iblai huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇