JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const envInfo of client.env.list()) {
console.log(envInfo.name);
}import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
page = client.env.list()
page = page.environments[0]
print(page.name)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Env.List(context.TODO(), agentlin.EnvListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.linxueyuan.online/v1/env \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.linxueyuan.online/v1/env")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"environments": [
{
"name": "<string>",
"source": "<string>",
"module": "<string>",
"importable": "<string>",
"default_params_summary": "<string>",
"origin": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Environment
List Environments
列出所有可用的环境
GET
/
env
JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const envInfo of client.env.list()) {
console.log(envInfo.name);
}import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
page = client.env.list()
page = page.environments[0]
print(page.name)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Env.List(context.TODO(), agentlin.EnvListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.linxueyuan.online/v1/env \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.linxueyuan.online/v1/env")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"environments": [
{
"name": "<string>",
"source": "<string>",
"module": "<string>",
"importable": "<string>",
"default_params_summary": "<string>",
"origin": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
Was this page helpful?