agent-remote / Exports / HttpClient
Class: HttpClient
Simple HTTP Client for Remote Communication
Table of contents
Constructors
Methods
Constructors
constructor
• new HttpClient(config): HttpClient
Parameters
| Name | Type |
|---|---|
config | IHttpClientConfig |
Returns
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
| Name | Type |
|---|---|
TData | extends TDefaultRequestData |
TResponse | TResponse |
Parameters
| Name | Type |
|---|---|
endpoint | string |
data | TData |
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
| Name | Type |
|---|---|
endpoint | string |
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
| Name | Type |
|---|---|
messages | IBasicMessage[] |
provider | string |
model | string |
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
| Name | Type |
|---|---|
messages | IBasicMessage[] |
provider | string |
model | string |
tools? | IToolSchema[] |
Returns
AsyncGenerator<IResponseMessage, any, any>
Defined in
agent-remote/src/client/http-client.ts:230
validateConfig
▸ validateConfig(): boolean
Validate configuration
Returns
boolean