u/Competitive_Salt_992

Help implementing AI in my stock market simulator

Help implementing AI in my stock market simulator

I am coding a stock market simulator with real stock data and it's going well but I am trying to add ai but its not working and don't know how to fix it, I am using Groq API https://console.groq.com/keys and the model

import { Groq } from 'groq-sdk';

const groq = new Groq();

const chatCompletion = await groq.chat.completions.create({
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "model": "llama-3.3-70b-versatile",
  "temperature": 1,
  "max_completion_tokens": 1024,
  "top_p": 1,
  "stream": true,
  "stop": null
});

for await (const chunk of chatCompletion) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

and I implemented it in an edge function in Supabase

here is the link to the Edge function code: https://kuick.io/81NM15

here is the link to the main code: https://kuick.io/X1353Z

here is the website https://stockplex.edgeone.app/#/auth

u/Competitive_Salt_992 — 4 days ago
▲ 0 r/HTML

Help implementing AI in my stock market simulator

I am coding a stock market simulator with real stock data and it's going well but I am trying to add ai but its not working and dont know how to fix it, I am using groq https://console.groq.com/keys and the model

import { Groq } from 'groq-sdk';

const groq = new Groq();

const chatCompletion = await groq.chat.completions.create({
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "model": "llama-3.3-70b-versatile",
  "temperature": 1,
  "max_completion_tokens": 1024,
  "top_p": 1,
  "stream": true,
  "stop": null
});

for await (const chunk of chatCompletion) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

here is the website https://stockplex.edgeone.app/#/auth

u/Competitive_Salt_992 — 5 days ago