|
1 | 1 | # Contributing |
2 | 2 |
|
3 | | -This repo is primarily maintained by autonomous agents, but humans can direct and override agent decisions at any time. |
| 3 | +## Core requirement |
4 | 4 |
|
5 | | -## Requesting a new example |
| 5 | +**Every example must use Deepgram directly or through a partner's tooling/API.** |
6 | 6 |
|
7 | | -Use the **Queue: New Example** issue template. The agent picks this up on its next daily run and builds the example. |
| 7 | +This means Deepgram STT, TTS, Voice Agents, or Audio Intelligence must be demonstrably called — either via the Deepgram SDK, or via a partner integration that routes audio through Deepgram (e.g. LiveKit → Deepgram, Pipecat → Deepgram, Twilio → Deepgram WebSocket). Examples that use a competing speech provider, or that merely reference Deepgram without making real API calls, will be rejected. |
8 | 8 |
|
9 | | -Alternatively, build it yourself using the [manual contribution](#manual-contribution) process below. |
| 9 | +## What makes a good example |
10 | 10 |
|
11 | | -## Reviewing open PRs |
12 | | - |
13 | | -The agent raises several PR types. Here's how to evaluate each: |
14 | | - |
15 | | -### `type:example` — New example app |
16 | | - |
17 | | -**Merge if:** The example is working, well-documented, and demonstrates a real use case. |
| 11 | +**In scope:** |
| 12 | +- Partners with a developer API (Twilio, Vonage, Zoom, etc.) |
| 13 | +- AI frameworks and toolkits (LangChain, LlamaIndex, Vercel AI SDK, etc.) |
| 14 | +- Frontend frameworks (React, Vue, Svelte, Next.js, Nuxt, etc.) |
| 15 | +- Voice/agent infrastructure that uses Deepgram as a provider (LiveKit, Pipecat, etc.) |
| 16 | +- Backend frameworks (FastAPI, Express, Gin, etc.) |
| 17 | +- Platforms and clouds (AWS, GCP, Azure serverless, etc.) |
18 | 18 |
|
19 | | -**Close (reject) if:** The integration is a direct Deepgram competitor (not a partner), the example is trivially simple with no instructional value, or it duplicates an existing example. |
| 19 | +**Out of scope:** |
| 20 | +- Direct Deepgram competitors that don't use our APIs |
| 21 | +- Trivial examples with no real integration value |
| 22 | +- Duplicate integrations (check existing examples and open PRs first) |
20 | 23 |
|
21 | | -**What happens after merge:** The `update-readme` workflow rebuilds the examples table in the root README automatically. |
| 24 | +## Reviewing PRs |
22 | 25 |
|
23 | | -### `type:fix` — Bug fix to existing example |
| 26 | +### `type:example` — New example |
24 | 27 |
|
25 | | -**Merge if:** The fix resolves the reported failure without breaking anything else. |
| 28 | +**Merge if:** Working, well-documented, demonstrates a real Deepgram use case. |
26 | 29 |
|
27 | | -**Close if:** The fix introduces new issues or the original example should be removed instead. |
| 30 | +**Close if:** Doesn't make real Deepgram API calls, uses a competing provider, is trivially simple, or duplicates an existing example. |
28 | 31 |
|
29 | | -## Rejecting a PR |
| 32 | +### `type:fix` — Bug fix |
30 | 33 |
|
31 | | -Close any PR without merging to reject it. Closed-unmerged PRs act as the agent's rejection memory — it will not re-propose the same integration. |
| 34 | +**Merge if:** Resolves the failure without breaking anything else. |
32 | 35 |
|
33 | | -To reverse a rejection, reopen the PR or create the example manually. |
| 36 | +**Close if:** Introduces new issues or the original example should be removed instead. |
34 | 37 |
|
35 | 38 | ## Manual contribution |
36 | 39 |
|
37 | | -To add an example yourself: |
38 | | - |
39 | 40 | 1. Find the next available number: |
40 | 41 | ```bash |
41 | 42 | ls examples/ | sort -n | tail -1 |
42 | 43 | # Use that number + 10 |
43 | 44 | ``` |
44 | 45 |
|
45 | | -2. Create the directory following the naming convention: |
| 46 | +2. Create the directory: |
46 | 47 | ```bash |
47 | 48 | mkdir -p examples/{NNN}-{slug}/{src,tests} |
48 | 49 | ``` |
49 | 50 |
|
50 | 51 | 3. Required files: |
51 | | - - `README.md` — description, prerequisites, env vars, how to run |
| 52 | + - `README.md` — what it does, prerequisites, env vars, how to run |
52 | 53 | - `.env.example` — every required env var (no values, just `VAR_NAME=`) |
53 | 54 | - Source code in `src/` |
54 | | - - Tests in `tests/` that exit 0 on success, 1 on failure, 2 on missing credentials |
| 55 | + - Tests in `tests/` — exit 0 pass, 1 fail, 2 missing credentials |
55 | 56 |
|
56 | | -4. Branch and PR: |
| 57 | +4. Open a PR: |
57 | 58 | ```bash |
58 | | - git checkout -b example/{slug} |
| 59 | + git checkout -b example/{NNN}-{slug} |
59 | 60 | git add examples/{NNN}-{slug}/ |
60 | 61 | git commit -m "feat(examples): add {description}" |
61 | | - git push origin example/{slug} |
62 | | - gh pr create --title "[Example] {description}" \ |
63 | | - --label "type:example" \ |
64 | | - --body "..." |
65 | | - ``` |
66 | | - |
67 | | -5. The PR body **must** include a metadata block so agents can parse it: |
68 | | - ```html |
69 | | - <!-- metadata |
70 | | - type: example |
71 | | - number: {NNN} |
72 | | - slug: {slug} |
73 | | - language: {node|python|go|rust|dotnet} |
74 | | - products: {stt,tts,agent,intelligence} |
75 | | - integrations: {platform or ecosystem slug} |
76 | | - --> |
| 62 | + git push origin example/{NNN}-{slug} |
| 63 | + gh pr create --title "[Example] {NNN} — {description}" --label "type:example" |
77 | 64 | ``` |
78 | 65 |
|
79 | 66 | ## Credential handling |
80 | 67 |
|
81 | 68 | If an example requires external service credentials: |
82 | 69 |
|
83 | | -1. List all required env vars in `.env.example` (one per line, format: `VAR_NAME=`) |
84 | | -2. Tests should check for missing vars and exit with code `2` — this signals "missing credentials" to CI, not a real test failure |
85 | | -3. CI will post a comment tagging `@deepgram-devrel` with the list of needed secrets |
86 | | -4. The PR stays open until the secrets are added and tests pass |
87 | | - |
88 | | -## What can agents build examples for? |
| 70 | +1. List all required env vars in `.env.example` |
| 71 | +2. Tests must check for missing vars and exit `2` — CI treats this as "skipped", not "failed" |
| 72 | +3. CI will comment with the list of secrets needed |
| 73 | +4. The PR stays open until secrets are added and tests pass |
89 | 74 |
|
90 | | -**Yes:** |
91 | | -- Partners with a developer API (Twilio, Vonage, Zoom, etc.) |
92 | | -- AI frameworks and toolkits (LangChain, LlamaIndex, Vercel AI SDK, etc.) |
93 | | -- Frontend frameworks (React, Vue, Svelte, Next.js, Nuxt, etc.) |
94 | | -- Voice/agent infrastructure that uses Deepgram as a provider (LiveKit, Pipecat, etc.) |
95 | | -- Backend frameworks (FastAPI, Express, Gin, etc.) |
96 | | -- Platforms and clouds (AWS, GCP, Azure serverless, etc.) |
97 | | - |
98 | | -**No:** |
99 | | -- Direct Deepgram competitors that don't use our APIs (AssemblyAI, ElevenLabs standalone, etc.) |
100 | | -- Trivial "hello world" examples with no real integration |
101 | | -- Duplicate integrations (check existing examples and open PRs first) |
102 | | - |
103 | | -## Queueing work manually |
| 75 | +## Numbering convention |
104 | 76 |
|
105 | | -Use the GitHub Issue templates: |
| 77 | +Examples are numbered globally in increments of 10. A platform owns its group — a second Twilio example gets `021`, not a new slot. New platforms claim the next free multiple of 10. |
106 | 78 |
|
107 | | -| Template | Effect | |
108 | | -|----------|--------| |
109 | | -| **Queue: New Example** | Agent builds an example for a specific integration | |
110 | | -| **Report: Broken Example** | Agent investigates and fixes a failing example | |
111 | | - |
112 | | -## Running agents locally |
113 | | - |
114 | | -```bash |
115 | | -# Requires: ANTHROPIC_API_KEY set, gh auth login done, git configured |
116 | | -claude --model claude-opus-4-6 -p "$(cat instructions/discover-examples.md)" |
117 | | -claude --model claude-opus-4-6 -p "$(cat instructions/create-example.md)" |
118 | | -``` |
119 | | - |
120 | | -## File structure reference |
| 79 | +## File structure |
121 | 80 |
|
122 | 81 | ``` |
123 | 82 | examples/ |
124 | | - {NNN}-{slug}/ # Three-digit number + kebab-case slug |
| 83 | + {NNN}-{slug}/ |
125 | 84 | README.md # Required |
126 | 85 | .env.example # Required if any env vars needed |
127 | 86 | src/ # Source code |
128 | | - tests/ # Tests with credential-checking convention |
129 | | -
|
130 | | -instructions/ # Agent prompts — humans can edit these |
131 | | - discover-examples.md # How agents find new integration ideas |
132 | | - create-example.md # How agents build examples |
133 | | - review-example.md # How agents review PRs |
134 | | - fix-example.md # How agents fix failing tests |
| 87 | + tests/ # Tests (exit 0/1/2 convention) |
135 | 88 |
|
136 | 89 | .github/ |
137 | | - workflows/ |
138 | | - discover-examples.yml # Weekly: search for new ideas, queue PRs |
139 | | - create-example.yml # Daily + on issue: build queued examples |
140 | | - review-pr.yml # On PR open/sync: self-review |
141 | | - fix-pr.yml # On status:fix-needed label: repair tests |
142 | | - test-node.yml # Node.js test runner |
143 | | - test-python.yml # Python test runner |
144 | | - test-go.yml # Go test runner |
145 | | - update-readme.yml # On merge: rebuild examples table |
| 90 | + workflows/ # CI workflows |
146 | 91 | ``` |
0 commit comments