forked from React-Group/interstellar_ai
live message! (limit:1)
This commit is contained in:
parent
2fc501d2bf
commit
8cc191dad1
3 changed files with 39 additions and 15 deletions
|
@ -2,17 +2,18 @@ import axios from "axios";
|
|||
|
||||
onmessage = (e) => {
|
||||
const { messages = [{ role: "assistant", content: "Hello! How can I help you?" }], ai_model = "phi3.5", access_token } = e.data
|
||||
|
||||
const promptedMessage = messages.unshift({role:"system", content:"You are a Helpful assistant"})
|
||||
messages.unshift({ role: "system", content: "You are a Helpful assistant" })
|
||||
|
||||
const Message = {
|
||||
messages: promptedMessage,
|
||||
messages: messages,
|
||||
ai_model: "phi3.5",
|
||||
model_type:"local",
|
||||
access_token:access_token
|
||||
}
|
||||
|
||||
console.log(Message);
|
||||
|
||||
|
||||
axios.post("http://localhost:5000/interstellar/api/ai_send",Message)
|
||||
.then(response => {
|
||||
const status = response.data.status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue