Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielh-silvestre/s1-agents
Simple library to connect WhatsApp Web into OpenAI Agents and Chat
https://github.com/gabrielh-silvestre/s1-agents
openai whatsapp-web
Last synced: 23 days ago
JSON representation
Simple library to connect WhatsApp Web into OpenAI Agents and Chat
- Host: GitHub
- URL: https://github.com/gabrielh-silvestre/s1-agents
- Owner: gabrielh-silvestre
- License: mit
- Created: 2023-11-18T23:08:40.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-12T20:22:27.000Z (10 months ago)
- Last Synced: 2024-10-14T16:01:58.125Z (23 days ago)
- Topics: openai, whatsapp-web
- Language: TypeScript
- Homepage:
- Size: 533 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# S1-Agent
## Install
```bash
bun add s1-zap-agents whatsapp-web.js
``````bash
npm i s1-zap-agents whatsapp-web.js
``````bash
yarn add s1-zap-agents whatsapp-web.js
```## Local Setup
### Docker
```bash
docker build --build-arg OPENAI_API_KEY=$OPENAI_API_KEY \
--build-arg AGENT_ID= \
-t s1-zap-agent:latest .
``````bash
docker run -it --rm s1-zap-agent:latest
```### [Bun](https://bun.sh)
```bash
bun i
``````bash
bun run src/bin.ts
```---
## Usage Example
```ts
export const client = new Client({
puppeteer: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
executablePath: process.env.CHROME_BIN,
headless: true,
},authStrategy: new LocalAuth(),
});startAgent(client, {
route: [
{
event: Events.MESSAGE_CREATE,
handlers: [
{ handler: AudioHandler },
{
handler: SpeechHandler,
opts: { command: '--to-audio', agent: new Agent(AgentEnum.audio) },
},
{
handler: TracribeHandler,
opts: { command: '--to-text', agent: new Agent(AgentEnum.audio) },
},
{
handler: TextHandler,
opts: { command: '/gpt', agent: new Agent(AgentEnum.raw) },
},
],
},
],
});
```