Skip to content

agent-remote / Exports / HttpClient

Class: HttpClient

Simple HTTP Client for Remote Communication

Table of contents

Constructors

Methods

Constructors

constructor

new HttpClient(config): HttpClient

Parameters

NameType
configIHttpClientConfig

Returns

HttpClient

Defined in

agent-remote/src/client/http-client.ts:74

Methods

post

post<TData, TResponse>(endpoint, data): Promise<IHttpResponse<TResponse>>

Send POST request with type safety

Type parameters

NameType
TDataextends TDefaultRequestData
TResponseTResponse

Parameters

NameType
endpointstring
dataTData

Returns

Promise<IHttpResponse<TResponse>>

Defined in

agent-remote/src/client/http-client.ts:82


get

get<TResponse>(endpoint): Promise<IHttpResponse<TResponse>>

Send GET request with type safety

Type parameters

Name
TResponse

Parameters

NameType
endpointstring

Returns

Promise<IHttpResponse<TResponse>>

Defined in

agent-remote/src/client/http-client.ts:141


chat

chat(messages, provider, model, tools?): Promise<IResponseMessage>

Execute chat request specifically

Parameters

NameType
messagesIBasicMessage[]
providerstring
modelstring
tools?IToolSchema[]

Returns

Promise<IResponseMessage>

Defined in

agent-remote/src/client/http-client.ts:156


chatStream

chatStream(messages, provider, model, tools?): AsyncGenerator<IResponseMessage, any, any>

Execute streaming chat request

Parameters

NameType
messagesIBasicMessage[]
providerstring
modelstring
tools?IToolSchema[]

Returns

AsyncGenerator<IResponseMessage, any, any>

Defined in

agent-remote/src/client/http-client.ts:230


validateConfig

validateConfig(): boolean

Validate configuration

Returns

boolean

Defined in

agent-remote/src/client/http-client.ts:415

Released under the MIT License.