https://discord.gg/botpress logo
@GamePlayer
# 🌎general
w
@quiet-raincoat-85414
Copy code
javascript
const url = 'https://api.mistral.ai/v1/chat/completions';

const headers = {
  'Authorization': 'Bearer YOUR_MISTRAL_KEY',
  'Content-Type': 'application/json',
};

const systemPrompt = `(YOUR SYSTEM PROMPT HERE)`;

const userPrompt = `(YOUR PROMPT HERE)`;

const data = {
  "model": "mistral-large-latest",
  "messages": [
    {
      "role": "system",
      "content": systemPrompt
    },
    {
      "role": "user", 
      "content": userPrompt
    }
  ],
  "max_tokens": 15000,
  "temperature": 1
};

const response = await axios.post(url, data, { headers });

const generatedMessage = response.data.choices[0].message.content;
user.response = generatedMessage
so just paste that into a execute code card
and fill in your mistral key, prompt and system prompt
q
k
w
then to show the response in chat add a text block with {{user.response}}
feel free to change model max tokens temperature etc
q
alright thanks sooo much
w
message has been deleted
q
♥
actually yeah this works
thanks
w
yeah it doesn't need to turn grene
but if you want to you can create a variable named "response" in the "user" scope
then it'll turn green
q
yeah i see
botpress is truly the goat of agentic ai, not too hard not too easy and has all the features
u know it ll become the best if they add a built in option to add LLM providers
like LLM Providers that can power autonomous nodes right?
w
yeah i think i'd be the best if they could just add something like openrouter
because it routes to all providers
q
yeah
w
and has most models out there
q
ut the main reason i used mistral here was to basically save on the botpress AI spend Limit
its hella annoying when i reach my quota
yes openrouter has all the models out there
its nice
w
yeah my main flow is basically all execute codes pointing to openrouter
q
otherwise if u use the normal bp features botpress is the simplest of everything outhere, like n8n flowwise
w
yeah i have a ton of n8n integrations in my flow as well haha
if you use the two you can do basically anything
q
yeah
but n8n is harder to leanr and is also paid
but anycase u an use docer and railway to self host it
docker*
w
yeah my n8n is hosted on elestio
so no workflow run limits
q
great me too
btw how old u are
w
i'm 21 haha why do you ask
q
hmm okay older than me to say the least
what tools would u recommend me for productivity
w
i don't know LOL i don't use any
i just open botpress and pray everything works
q
LOL
i recommend u use warp makes coding easier or it just codes for u too. also cursor is nice
Botpress AI on their docs age is pretty useless right, U agree wiht me
w
yeah i use cursor on bigger projects
q
hmm okay
w
i don't know, i've never used it
q
right
same for me
never got a nice point to use it
idk bout u but i play video games do u play any
i eman almost every discord person plays a game
arght ima log off
Still cant believe this place solved a problem to which i was searching an answer to for days from AI
hmmm, so after i built my workflow and added prompts and things it seems like that it doesnt work besides just the introduction. also it doesnt accept temerature values other than 1. about the first isue it is very similar to what can happen in n8n like there if prompt and things are as variables they work if they are fixed they dont.so can yall tell me will using variables work for me or how to fix these problems at all anyone?. just reply and ill tets it later cuz i dont have my botpress running rn(its not open rn)
wrapping system prompt in a variable seems more logical too as botpress uses it too, like that instructions area in ai nodes also is stored in a variable and then is processes right? folks
w
the temperature issue i don't get, it's implemented in the code exactly as in the api (https://docs.mistral.ai/api/#tag/chat/operation/chat_completion_v1_chat_completions_post)
as for the second issue, could you explain it to me again? i couldn't really understand
q
u see if i add a prompt to it in the system prompt it just does an introduction and when i ask it a question it doesnt repond to the question eventho it should have access to internet.
should i add the prompt as a variable like how you do it in n8n