POST /api/v1/invoke_llm
This endpoint allows you to invoke a language model using specific parameters, such as the expert and model IDs, input data, and additional configuration options.
bbot-api-key
: Your API key, which can be generated from the Profile section of the B-Bot hub.The request body should be a JSON object with the following structure:
{
"expert_id": 37,
"model_id": 6,
"input_data": [
{"role": "user", "content": "Hello!"}
],
"temperature": 1,
"max_tokens": 250
}
expert_id
(integer): The ID of the expert you want to invoke.model_id
(integer): The ID of the language model to be used.input_data
(array): A list of message objects containing the role and content of the input data.
role
(string): The role of the message sender, typically "user" or "system".content
(string): The content of the message.temperature
(float): The sampling temperature, which controls the randomness of the model's outputs. Higher values (e.g., 1.0) make the output more random, while lower values (e.g., 0.2) make it more deterministic.max_tokens
(integer): The maximum number of tokens (words or word pieces) to generate in the response.bashCode kopieren
curl -X POST <https://your-api-url.com/api/v1/invoke_llm> \\
-H "Content-Type: application/json" \\
-H "bbot-api-key: YOUR_API_KEY_HERE" \\
-d '{
"expert_id": 37,
"model_id": 6,
"input_data": [
{"role": "user", "content": "Hello!"}
],
"temperature": 1,
"max_tokens": 250
}'
jsonCode kopieren
{
"response": {
"id": "chatcmpl-9kCotn4TY5OcxYc8qFlulso5v8BpC",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today in the realm of marketing psychology for your business?",
"role": "assistant",
"function_call": null,
"tool_calls": null}
}
],
"created": 1720799395,
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion",
"system_fingerprint": null,
"usage": {
"completion_tokens": 18,
"prompt_tokens": 40,
"total_tokens": 58
}
}
}