Full disclosure this is my first make custom app but I think I am following all the instructions available from make and the api (Groq) that I’m trying to connect to.
if I run the following from my terminal it works fine and produces an output:
curl -X POST “https://api.groq.com/openai/v1/chat/completions”
-H “Authorization: Bearer ”
-H “Content-Type: application/json”
-d ‘{“messages”: [{“role”: “user”, “content”: “pick yes or no”}], “model”: “mixtral-8x7b-32768”}’
but when I try to create a connection in the custom app it comes back with a 401 error.
Connection:Communication
{
“url”: “https://api.groq.com/openai/v1/chat/completions”,
“method”: “POST”,
“headers”: {
“Authorization”: “Bearer {{paramaters.apiKey}}”,
“Content-Type”: “application/json”
},
“qs”: {
“messages”: [ { “role”: “user”, “content”: “can you hear me?” } ],
“model”: “mixtral-8x7b-32768”
},
“log”: {
“sanitize”: [
“request.headers.authorization”
]
}
}
Connection: Parameters
[
{
“name”: “apiKey”,
“type”: “text”,
“label”: “API Key”,
“help”: “Enter the API key provided by Groq”,
“required”: true
}
]
Base:
{
// Default request configuration
“baseUrl”: “https://api.groq.com/openai/v1”, // Default base URL for all modules and RPCs.
“method”: “POST”,
“headers”: {
“Authorization”: “Bearer {{connection.apiKey}}”,
“Content-Type”: “application/json”
},
“response”: {
“error”: {
“message”: “[{{statusCode}}] {{body.error}}”
}
},
“log”: {
“sanitize”: [ // Excludes sensitive parameters from logs.
“request.headers.authorization” // Omit HTTP header “Authorization”.
]
}
}
Modules: Communication
{
// Request to API endpoint.
“url”: “/chat/completions”, // Relative to base URL
“method”: “POST”,
“qs”: {
“messages”: [
{
“role”: “{{parameters.role}}”,
“content”: “{{parameters.prompt}}”
}
],
“model”: “mixtral-8x7b-32768”
},
“body”: {},
“response”: {
“output”: “{{body}}”
}
}
Module: Mappable Parameters
[
{
“name”: “role”,
“type”: “text”,
“label”: “Role”,
“required”: true
},
{
“name”: “prompt”,
“type”: “text”,
“label”: “Prompt”,
“required”: true
}
]
I’m not sure where I am going wrong, any insight would be appreciated.