FULLMETAL
  • Introduction
  • 💰$BNTY Support
  • 🔑Getting an API Key
  • 🤖Managing Agents in Fullmetal
  • Installation Guides
    • Setting up an Node (Deploy a Node)
      • On a Browser
      • on a VM (node.js)
  • Examples
    • Fullmetal Chat Example
  • API Docs
    • Response on prompt
  • Contributions
    • Code of Conduct
Powered by GitBook
On this page
  1. API Docs

Response on prompt

PreviousFullmetal Chat ExampleNextCode of Conduct

Last updated 1 month ago

POST Prompt

Request Headers

  • Content-Type: application/json

  • apikey: Your API key (required for authentication), see

Request Body

The request body should be in JSON format and must include the following fields

{
  "agentId": "string",        // The ID of the agent to which the prompt is sent (required)
  "prompt": "string",         // The prompt text to be sent to the agent (required)
  "systemPrompt": "string",   // Optional system prompt to provide context (optional)
  "stream": "boolean"         // Indicates whether to use streaming for the response (optional)
}

Example

var myHeaders = new Headers();
myHeaders.append("apikey", "{{apikey}}");

var raw = "{\r\n      \"prompt\": \"Hello, how are you?\",\r\n      \"agentId\": \"{{agentId}}\",\r\n      \"stream\": false\r\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.fullmetal.ai/agent/prompt", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Example

curl --location 'https://api.fullmetal.ai/agent/prompt' \
--header 'apikey: {{apikey}}' \
--data '{
      "prompt": "Hello, how are you?",
      "agentId": "{{agentId}}",
      "stream": false
}'

Example

import requests

url = "https://api.fullmetal.ai/agent/prompt"

payload = "{\r\n      \"prompt\": \"Hello, how are you?\",\r\n      \"agentId\": \"{{agentId}}\",\r\n      \"stream\": true\r\n}"
headers = {
  'apikey': '{{apikey}}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Response

{
  "response": "I'm just a language model, I don't have emotions or feelings like humans do, but I'm functioning properly and ready to assist you. I'm here to help with any questions or topics you'd like to discuss. How can I help you today?",
  "model": [
    "Llama-3.2-1B-Instruct-q4f16_1-MLC"
  ],
  "speed": "13.86",
  "elapsedTime": "16.24"
}

For more information please visit the

https://api.fullmetal.ai/agent/prompt
HERE
postman collection