Skip to content

[Vblocks 4993] conversation relay #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: feature/conversation-relay
Choose a base branch
from

Conversation

kpchoy
Copy link
Contributor

@kpchoy kpchoy commented Jul 17, 2025

Conversation Relay integration

  • Make outgoing call to connect with an agent
  • Websocket server
  • Basic OpenAI integration

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

@kpchoy kpchoy force-pushed the VBLOCKS-4993-setup-websocket branch from 9a4ab42 to 2a3af30 Compare July 17, 2025 18:22
Copy link
Contributor

@mhuynh5757 mhuynh5757 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good!

@@ -0,0 +1,18 @@
(async function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(async function () {
(async function() {

@@ -8,11 +8,12 @@ const authToken = process.env.AUTH_TOKEN;
const callerId = process.env.CALLER_ID;
const callbackBaseUrl = process.env.CALLBACK_BASE_URL;
const defaultIdentity = process.env.DEFAULT_IDENTITY;
const openaiApiKey = process.env.OPENAI_API_KEY;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to consider making this one optional.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I guess customers can just put like 'foobar' here or something.

src/server.js Outdated
async function aiResponse(messages) {
let completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: messages,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
messages: messages,
messages,

src/server.js Outdated
// LLM
const openai = new OpenAI({ apiKey: openaiApiKey });
async function aiResponse(messages) {
let completion = await openai.chat.completions.create({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let completion = await openai.chat.completions.create({
const completion = await openai.chat.completions.create({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants