跳到正文
GitHub·· 5 天前AI 评分18

Soenneker.OpenHands.OpenApiClient:用于 .NET 调用 OpenHands Cloud API 的类型化客户端

soenneker/soenneker.openhands.openapiclient

AI 导读

Soenneker.OpenHands.OpenApiClient 发布,为 .NET 提供调用 OpenHands Cloud API 的类型化请求构建器与模型,可通过 `dotnet add package` 安装。

正文

Typed request builders and models for calling the OpenHands Cloud API from .NET.

Installation

dotnet add package Soenneker.OpenHands.OpenApiClient

Usage

using System.Net.Http.Headers;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;
using Soenneker.OpenHands.OpenApiClient;

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", apiKey);

var adapter = new HttpClientRequestAdapter(
    new AnonymousAuthenticationProvider(),
    httpClient: httpClient);
adapter.BaseUrl = "https://app.all-hands.dev";

var client = new OpenHandsOpenApiClient(adapter);
var conversations = await client.Api.V1.AppConversations.Search.GetAsync(request =>
{
    request.QueryParameters.Limit = 20;
}, cancellationToken);

Set the request adapter's base URL before constructing the client. The generated surface includes conversations, sandboxes, repositories, configuration, secrets, integrations, and service-health endpoints.

For configuration-based credentials and managed client reuse, use Soenneker.OpenHands.OpenApiClientUtil.

来源:GitHub · github.com