GitHub 文件夹下载器

添加一个下载按钮,允许轻松下载特定的 GitHub 文件夹。

< 脚本 GitHub 文件夹下载器 的反馈

提问 / 留言

§
发布于:2025-06-06

<?php require 'vendor/autoload.php';

use GuzzleHttp\Client; use Dotenv\Dotenv;

$dotenv = Dotenv::createImmutable(DIR); $dotenv->load();

$apiKey = $_ENV['API_KEY'] ?? null;

if (!$apiKey) { echo "Error: Missing API_KEY in .env\n"; exit(1); }

function createChatSession($externalUserId, $apiKey) { $client = new Client(); $url = 'https://api.on-demand.io/chat/v1/sessions'; $headers = [ 'apikey' => $apiKey, 'Content-Type' => 'application/json' ]; $body = [ 'agentIds' => [], 'externalUserId' => $externalUserId ];

try {
    $response = $client->post($url, [
        'headers' => $headers,
        'json' => $body
    ]);
    $data = json_decode($response->getBody(), true);
    return $data['data']['id'] ?? null;
} catch (Exception $e) {
    $message = $e->getMessage();
    echo "Session creation failed: $message\n";
    throw new Exception("Failed to create session: $message");
}

}

function submitQuery($sessionId, $query, $apiKey) { $client = new Client(); $url = "https://api.on-demand.io/chat/v1/sessions/{$sessionId}/query"; $headers = [ 'apikey' => $apiKey, 'Content-Type' => 'application/json' ]; $body = [ 'endpointId' => 'predefined-openai-gpt4o', 'query' => $query, 'agentIds' => 'agent-1712327325

发布留言

登录(不可用)以发布留言。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址