curl --request POST \
--url http://localhost:8000/api/v1/chat/execute-gemini-prompt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": {
"prompt": "<string>",
"id": 123,
"prompt_variables": [
"<string>"
],
"prompt_formatting_data": {},
"formatted_prompt": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"model_name": "<string>",
"temperature": 123
},
"prompt_request": {
"extra_data": {}
}
}
'import requests
url = "http://localhost:8000/api/v1/chat/execute-gemini-prompt"
payload = {
"prompt": {
"prompt": "<string>",
"id": 123,
"prompt_variables": ["<string>"],
"prompt_formatting_data": {},
"formatted_prompt": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"model_name": "<string>",
"temperature": 123
},
"prompt_request": { "extra_data": {} }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: {
prompt: '<string>',
id: 123,
prompt_variables: ['<string>'],
prompt_formatting_data: {},
formatted_prompt: '<string>',
date_added: '2023-11-07T05:31:56Z',
date_updated: '2023-11-07T05:31:56Z',
model_name: '<string>',
temperature: 123
},
prompt_request: {extra_data: {}}
})
};
fetch('http://localhost:8000/api/v1/chat/execute-gemini-prompt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/chat/execute-gemini-prompt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => [
'prompt' => '<string>',
'id' => 123,
'prompt_variables' => [
'<string>'
],
'prompt_formatting_data' => [
],
'formatted_prompt' => '<string>',
'date_added' => '2023-11-07T05:31:56Z',
'date_updated' => '2023-11-07T05:31:56Z',
'model_name' => '<string>',
'temperature' => 123
],
'prompt_request' => [
'extra_data' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/chat/execute-gemini-prompt"
payload := strings.NewReader("{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/chat/execute-gemini-prompt")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/chat/execute-gemini-prompt")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Execute Gemini Prompt
Execute the Gemini prompt via OpenRouter.
Args: prompt (FormattedGeminiPromptSchema): The formatted Gemini prompt campaign_id (int): The ID of the campaign customer_id (int): The ID of the Google Ads customer login_customer_id (int | None): The ID of the Google Ads login customer prompt_request (GetFormattedPromptRequestSchema | None): The request to get the formatted prompt as_user_id (int | None): The ID of the user to impersonate admin_user (User): The current user model_name (str | None): The model name (defaults to settings.OPENROUTER_DEFAULT_MODEL) temperature (float | None): The temperature for the model
Returns: dict: The response
curl --request POST \
--url http://localhost:8000/api/v1/chat/execute-gemini-prompt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": {
"prompt": "<string>",
"id": 123,
"prompt_variables": [
"<string>"
],
"prompt_formatting_data": {},
"formatted_prompt": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"model_name": "<string>",
"temperature": 123
},
"prompt_request": {
"extra_data": {}
}
}
'import requests
url = "http://localhost:8000/api/v1/chat/execute-gemini-prompt"
payload = {
"prompt": {
"prompt": "<string>",
"id": 123,
"prompt_variables": ["<string>"],
"prompt_formatting_data": {},
"formatted_prompt": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"model_name": "<string>",
"temperature": 123
},
"prompt_request": { "extra_data": {} }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: {
prompt: '<string>',
id: 123,
prompt_variables: ['<string>'],
prompt_formatting_data: {},
formatted_prompt: '<string>',
date_added: '2023-11-07T05:31:56Z',
date_updated: '2023-11-07T05:31:56Z',
model_name: '<string>',
temperature: 123
},
prompt_request: {extra_data: {}}
})
};
fetch('http://localhost:8000/api/v1/chat/execute-gemini-prompt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/chat/execute-gemini-prompt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => [
'prompt' => '<string>',
'id' => 123,
'prompt_variables' => [
'<string>'
],
'prompt_formatting_data' => [
],
'formatted_prompt' => '<string>',
'date_added' => '2023-11-07T05:31:56Z',
'date_updated' => '2023-11-07T05:31:56Z',
'model_name' => '<string>',
'temperature' => 123
],
'prompt_request' => [
'extra_data' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/chat/execute-gemini-prompt"
payload := strings.NewReader("{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/chat/execute-gemini-prompt")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/chat/execute-gemini-prompt")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": {\n \"prompt\": \"<string>\",\n \"id\": 123,\n \"prompt_variables\": [\n \"<string>\"\n ],\n \"prompt_formatting_data\": {},\n \"formatted_prompt\": \"<string>\",\n \"date_added\": \"2023-11-07T05:31:56Z\",\n \"date_updated\": \"2023-11-07T05:31:56Z\",\n \"model_name\": \"<string>\",\n \"temperature\": 123\n },\n \"prompt_request\": {\n \"extra_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Body
Response
Successful Response
The response is of type Response Execute Gemini Prompt Api V1 Chat Execute Gemini Prompt Post · object.