Agent Runs
Despertar a un agente durmiente ejecutar
Interrumpe una llamada de herramienta de sueño corto en un fondo al reenvíar la entrada de seguimiento a la respuesta de la puerta de enlace.
POST
/
api
/
v1
/
agents
/
{agent_id}
/
runs
/
{run_id}
/
wake
Typescript (SDK)
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentRuns.wakeAgentRun({
agentId: "<id>",
runId: "<id>",
wakeAgentRunRequest: {
input: [
{},
],
},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.AgentRuns.WakeAgentRun(ctx, "<id>", "<id>", components.WakeAgentRunRequest{
Input: components.CreateWakeAgentRunRequestInputUnionArrayOfWakeAgentRunRequestInput(
[]components.WakeAgentRunRequestInput{
components.WakeAgentRunRequestInput{},
},
),
}, nil)
if err != nil {
log.Fatal(err)
}
if res.AgentRunWake != nil {
// handle response
}
}using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.AgentRuns.WakeAgentRunAsync(
agentId: "<id>",
runId: "<id>",
body: new MeetKai.MKA1.Types.Components.WakeAgentRunRequest() {
Input = WakeAgentRunRequestInputUnion.CreateArrayOfWakeAgentRunRequestInput(
new List<WakeAgentRunRequestInput>() {
new WakeAgentRunRequestInput() {},
}
),
}
);
// handle responsefrom meetkai_mka1 import SDK, models
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.agent_runs.wake_agent_run(agent_id="<id>", run_id="<id>", input=[
models.WakeAgentRunRequestInput(),
])
# Handle response
print(res)curl --request POST \
--url https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>'})
};
fetch('https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake",
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([
'input' => '<string>'
]),
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;
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "agent.run.wake",
"run_id": "<string>",
"gateway_response_id": "<string>",
"gateway_wake": {}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}Autorizaciones
Send Authorization: Bearer , using an MKA1 API key for automation or an OAuth API access token for a signed-in application. Use a dynamic security callback to refresh OAuth access tokens. Browser session-only operations still require their declared cookie.
Encabezados
Optional external end-user identifier forwarded by the API gateway.
Cuerpo
application/json
Required string length:
1 - 20000¿Esta página le ayudó?
⌘I
Typescript (SDK)
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentRuns.wakeAgentRun({
agentId: "<id>",
runId: "<id>",
wakeAgentRunRequest: {
input: [
{},
],
},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New(
mka1.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
res, err := s.AgentRuns.WakeAgentRun(ctx, "<id>", "<id>", components.WakeAgentRunRequest{
Input: components.CreateWakeAgentRunRequestInputUnionArrayOfWakeAgentRunRequestInput(
[]components.WakeAgentRunRequestInput{
components.WakeAgentRunRequestInput{},
},
),
}, nil)
if err != nil {
log.Fatal(err)
}
if res.AgentRunWake != nil {
// handle response
}
}using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.AgentRuns.WakeAgentRunAsync(
agentId: "<id>",
runId: "<id>",
body: new MeetKai.MKA1.Types.Components.WakeAgentRunRequest() {
Input = WakeAgentRunRequestInputUnion.CreateArrayOfWakeAgentRunRequestInput(
new List<WakeAgentRunRequestInput>() {
new WakeAgentRunRequestInput() {},
}
),
}
);
// handle responsefrom meetkai_mka1 import SDK, models
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.agent_runs.wake_agent_run(agent_id="<id>", run_id="<id>", input=[
models.WakeAgentRunRequestInput(),
])
# Handle response
print(res)curl --request POST \
--url https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>'})
};
fetch('https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake",
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([
'input' => '<string>'
]),
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;
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/agents/{agent_id}/runs/{run_id}/wake")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "agent.run.wake",
"run_id": "<string>",
"gateway_response_id": "<string>",
"gateway_wake": {}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}