Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ jobs:

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.10"
bun-version: "1.3.13"

- run: bun install
- uses: actions/setup-node@v6
with:
node-version: 22

- name: Typecheck
run: bun run typecheck
- run: bun install

- name: Build
run: bun run build

- name: Typecheck
run: bun run typecheck

- name: Test
run: bun run test
27 changes: 4 additions & 23 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.10"
bun-version: "1.3.13"

- uses: actions/setup-node@v6
with:
Expand All @@ -64,45 +64,26 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: actions/checkout@v6
with:
repository: deepgram/react
path: ../react

- uses: actions/checkout@v6
with:
repository: deepgram/ui
path: ../ui

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.10"
bun-version: "1.3.13"

- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org

- name: Build dependencies
run: |
cd ../react && bun install && bun run build
cd ../ui && bun install && bun run build

- run: bun install

- run: bun run --filter '@deepgram/agents' --filter '@deepgram/agents-widget' build
- run: bun run --filter '@deepgram/agents-widget' build

- name: Swap file pointers to npm versions
- name: Pin @deepgram/agents to the SDK version being released
run: |
SDK_VERSION=$(node -e "console.log(require('./packages/sdk/package.json').version)")
REACT_VERSION=$(node -e "console.log(require('../react/packages/react/package.json').version)")
UI_VERSION=$(node -e "console.log(require('../ui/packages/ui/package.json').version)")
node -e "
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('packages/widget/package.json', 'utf8'));
pkg.dependencies['@deepgram/agents'] = SDK_VERSION;
pkg.dependencies['@deepgram/react'] = REACT_VERSION;
pkg.dependencies['@deepgram/ui'] = UI_VERSION;
fs.writeFileSync('packages/widget/package.json', JSON.stringify(pkg, null, 2) + '\n');
"

Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/publish.yml

This file was deleted.

21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ React hooks and UI components live in their own repos:

### Widget (no framework)

```html
<script src="https://cdn.deepgram.com/agent-widget/latest/widget.umd.js"></script>
<script>
DeepgramAgent.init({
tokenFactory: () => fetch('/api/deepgram-token').then(r => r.text()),
agent: { think: { provider: { type: 'open_ai' }, model: 'gpt-4o-mini' } },
});
</script>
```bash
npm install @deepgram/agents-widget
```

```ts
import { init } from "@deepgram/agents-widget";

init({
tokenFactory: () => fetch('/api/deepgram-token').then(r => r.text()),
agent: { think: { provider: { type: 'open_ai' }, model: 'gpt-4o-mini' } },
});
```

The package also ships a UMD bundle at `dist/widget.umd.js` for `<script>`-tag usage; host it from your own server.

### React

```tsx
Expand Down
Loading