Skip to content

Commit

Permalink
update packages & readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
Regaddi committed Jul 18, 2024
1 parent c172954 commit 7c4d740
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 19 deletions.
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
# Groq Voice SDK (Sketch)

This project establishes the main interface for Groq + Daily.
## Install

We're using a vanilla Typescript application (served with Vite) for local testing.
```bash
# Install dependencies & link packages
yarn
# Build voice-sdk
yarn workspace @realtime-ai/voice-sdk build
# Build voice-sdk-react
yarn workspace @realtime-ai/voice-sdk-react build
```

Entry point: `src/main.ts`
SDK: `src/groq-voice-sdk`
## Bump and publish voice-sdk

```bash
# Bump version
yarn workspace @realtime-ai/voice-sdk version --patch/--minor/--major --message "Bump voice-sdk version"
# Build
yarn workspace @realtime-ai/voice-sdk build
# Verify package content
npm pack --dry-run --workspace=@realtime-ai/voice-sdk
# Publish package
npm publish --workspace=@realtime-ai/voice-sdk
```

## Bump and publish voice-sdk-react

```bash
# Bump version
yarn workspace @realtime-ai/voice-sdk-react version --patch/--minor/--major --message "Bump voice-sdk version"
# Build
yarn workspace @realtime-ai/voice-sdk-react build
# Verify package content
npm pack --dry-run --workspace=@realtime-ai/voice-sdk-react
# Publish package
npm publish --workspace=@realtime-ai/voice-sdk-react
```
9 changes: 9 additions & 0 deletions voice-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Real-Time Voice Inference SDK Demo

## Run dev server

```bash
yarn dev
# or from project root
yarn workspace voice-demo dev
```
6 changes: 3 additions & 3 deletions voice-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
},
"dependencies": {
"@daily-co/daily-js": "^0.67.0",
"@realtime-ai/voice-sdk": "*",
"@realtime-ai/voice-sdk-react": "*",
"@vitejs/plugin-react": "^4.3.1",
"events": "^3.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typed-emitter": "^2.1.0",
"voice-sdk": "*",
"voice-sdk-react": "*"
"typed-emitter": "^2.1.0"
}
}
7 changes: 5 additions & 2 deletions voice-demo/src/DemoApp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useCallback, useRef, useState } from "react";
import { useVoiceClient, useVoiceClientEvent } from "voice-sdk-react";
import { VoiceEvent } from "voice-sdk";
import {
useVoiceClient,
useVoiceClientEvent,
} from "@realtime-ai/voice-sdk-react";
import { VoiceEvent } from "@realtime-ai/voice-sdk";

export const DemoApp = () => {
const voiceClient = useVoiceClient();
Expand Down
4 changes: 2 additions & 2 deletions voice-demo/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRoot } from "react-dom/client";
import { VoiceClient, VoiceEvent } from "voice-sdk";
import { VoiceClientProvider } from "voice-sdk-react";
import { VoiceClient, VoiceEvent } from "@realtime-ai/voice-sdk";
import { VoiceClientProvider } from "@realtime-ai/voice-sdk-react";

import { DemoApp } from "./DemoApp";

Expand Down
50 changes: 50 additions & 0 deletions voice-sdk-react/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Real-Time Voice Inference React SDK

tbd.

## Install

```bash
yarn add voice-sdk voice-sdk-react
# or
npm install voice-sdk voice-sdk-react
```

## Getting started

```tsx
import { VoiceClient } from "@realtime-ai/voice-sdk";
import {
useVoiceClient,
VoiceClientProvider,
} from "@realtime-ai/voice-sdk-react";

const voiceClient = new VoiceClient({
apiKey: "",
enableMic: true,
});

render(
<VoiceClientProvider voiceClient={voiceClient}>
<MyVoiceApp />
</VoiceClientProvider>
);

const MyVoiceApp = () => {
const voiceClient = useVoiceClient();

return (
<>
<button onClick={() => voiceClient?.start()}>Talk to a bot</button>
</>
);
};
```

## Advanced configuration

tbd.

## Contributing

tbd.
15 changes: 10 additions & 5 deletions voice-sdk-react/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"name": "voice-sdk-react",
"name": "@realtime-ai/voice-sdk-react",
"private": true,
"version": "0.1.0",
"main": "dist/index.js",
"module": "dist/index.module.js",
"types": "dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"package.json",
"README.md"
],
"scripts": {
"build": "parcel build src/index.ts",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"devDependencies": {
"@realtime-ai/voice-sdk": "*",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
Expand All @@ -21,12 +27,11 @@
"parcel": "^2.12.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.2.2",
"voice-sdk": "*"
"typescript": "^5.2.2"
},
"peerDependencies": {
"@realtime-ai/voice-sdk": "*",
"react": ">=18",
"react-dom": ">=18",
"voice-sdk": "*"
"react-dom": ">=18"
}
}
2 changes: 1 addition & 1 deletion voice-sdk-react/src/VoiceClientProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext } from "react";

import { VoiceClient } from "voice-sdk";
import { VoiceClient } from "@realtime-ai/voice-sdk";

interface Props {
voiceClient: VoiceClient;
Expand Down
2 changes: 1 addition & 1 deletion voice-sdk-react/src/useVoiceClientEvent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from "react";
import type { VoiceEvent, VoiceEventHandler } from "voice-sdk";
import type { VoiceEvent, VoiceEventHandler } from "@realtime-ai/voice-sdk";
import { useVoiceClient } from "./useVoiceClient";

export const useVoiceClientEvent = <E extends VoiceEvent>(
Expand Down
32 changes: 32 additions & 0 deletions voice-sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Real-Time Voice Inference SDK

tbd.

## Install

```bash
yarn add voice-sdk
# or
npm install voice-sdk
```

## Getting started

```ts
import { VoiceClient } from "@realtime-ai/voice-sdk";

const voiceClient = new VoiceClient({
apiKey: "",
enableMic: true,
});

voiceClient.start();
```

## Advanced configuration

tbd.

## Contributing

tbd.
7 changes: 6 additions & 1 deletion voice-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"name": "voice-sdk",
"name": "@realtime-ai/voice-sdk",
"private": true,
"version": "0.1.0",
"main": "dist/index.js",
"module": "dist/index.module.js",
"types": "dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"package.json",
"README.md"
],
"scripts": {
"build": "parcel build",
"lint": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0"
Expand Down

0 comments on commit 7c4d740

Please sign in to comment.