- Expose localhost's port 4001 to public internet using ngrok:
ngrok tcp 4001
. Tip: Use -region= flag for lower latency. - Note the hostname and port returned by ngrok in the form:
tcp://hostname:port -> localhost:4001
- Open the ipfs config json file
~/.ipfs/config
- Edit as follows: Addresses.Announce=["/dns4/put-the-hostname-here/tcp/put-the-port-here"]
- Save the config file
ipfs daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getAIResponse(userSpeech: string): Promise<string> { | |
const response = await fetch( | |
`${openAIEndpoint}/openai/deployments/Woodstock-AI/completions?api-version=2024-06-01`, | |
{ | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json", | |
Authorization: `Bearer ${openAIAPIKey}`, | |
}, | |
body: JSON.stringify({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify, render_template | |
from flask_cors import CORS | |
from dotenv import load_dotenv | |
import os | |
import azure.cognitiveservices.speech as speechsdk | |
import wave | |
# Load environment variables from .env file | |
load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import azure.cognitiveservices.speech as speechsdk | |
import requests | |
import json | |
from dotenv import load_dotenv | |
load_dotenv() | |
# Azure OpenAI service credentials | |
speech_endpoint = os.getenv("SPEECH_ENDPOINT") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handle auth route | |
func authHandler(c echo.Context) error { | |
// how we can get params sent in the message like this one? => `{"action": "auth", "params", "<<api key>>"}` | |
// check api key in param and do auth | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handle $connect event | |
func connectHandler(c echo.Context) error { | |
// Extract connection ID from headers | |
connectionID := c.Request().Header.Get("Sec-WebSocket-Protocol") | |
// Perform actions when a client connects | |
fmt.Printf("Client connected: %s\n", connectionID) // ==========> we didn't get the connectionID, it's empty | |
// Respond with a 200 status code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"messages": [{"role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."}, {"role": "user", "content": "Is Xbox better than PlayStation?"}, {"role": "assistant", "content": "I apologize, but I cannot provide personal opinions. My primary job is to assist you with any issues related to your Xbox device. Do you have any Xbox-related issues that need addressing?"}]} | |
{"messages": [{"role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."}, {"role": "user", "content": "Can I play PC games on my Xbox?"}, {"role": "assistant", "content": "While X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this code snippet in your app. | |
// If you need more information about configurations or implementing the sample code, visit the AWS docs: | |
// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/setting-up.html | |
import ( | |
"github.com/aws/aws-sdk-go/service/secretsmanager" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/awserr" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"encoding/base64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/middleware" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wsclient | |
import ( | |
"fmt" | |
"github.com/gorilla/websocket" | |
pubsub "github.com/woodstock-tokyo/simple-pubsub" | |
"github.com/woodstock-tokyo/woodstock-alpaca/server/util" | |
) |
NewerOlder