Friday, 10 January 2025

const aiResponse = await getOpenAIResponse(enrichedPrompt); const openAIResponse = `✨ Wow! Great question, Gazi Pollob Hussain! Here's what I found for you: ${aiResponse}`;

const aiResponse = await getOpenAIResponse(enrichedPrompt); const openAIResponse = `✨ Wow! Great question, Gazi Pollob Hussain! Here's what I found for you: ${aiResponse}`; res.json({ message: openaiResponse }); version: '3.8' services: core_api: build: ./core_api ports: - "5000:5000" environment: - OPENAI_API_KEY=${sk-5k98H4I4kx3m234Lf1VfJ8wETc5RrTu5KlW} websocket_server: build: ./websocket_server ports: - "8765:8765" kafka: image: wurstmeister/kafka ports: - "9092:9092" environment: KAFKA_ADVERTISED_HOST_NAME: localhost KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 zookeeper: image: wurstmeister/zookeeper ports: - "2181:2181" redis: image: redis:alpine ports: - "6379:6379" monitoring: build: ./monitoring ports: - "8000:8000" curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0-darwin-x86_64.tar.gz tar -xvf elasticsearch-7.10.0-darwin-x86_64.tar.gz cd elasticsearch-7.10.0 ./bin/elasticsearch const express = require('express'); const { generateAuthUrl, handleCallback } = require('./auth'); const { fetchResponse } = require('./openaiClient'); const app = express(); // Route to initiate Google OAuth app.get('/auth/google', (req, res) => { generateAuthUrl(); // Redirect user to Google OAuth URL }); // Callback route for Google OAuth app.get('/auth/google/callback', (req, res) => { const { code } = req.query; handleCallback(code); res.send('Authentication successful'); }); // Route to interact with OpenAI app.get('/ask', async (req, res) => { const { question } = req.query; try { const answer = await fetchResponse(question); res.json({ answer }); } catch (error) { res.status(500).send('Error processing your request'); } }); app.listen(3000, () => { console.log('Server is running on http://localhost:3000'); });  

No comments:

Post a Comment

curl -I https://aikoinfinity.blogspot.com/p/home.html

https://developers.google.com/profile/u/GiXsync

Aikore Chat Widget