メインコンテンツまでスキップ
バージョン: 次へ

OpenAIResult

The OpenAIResult class is designed to handle the response from HTTP requests and provides functions to evaluate the success of the request, retrieve body content, and collect any errors that may have occurred during processing.

プロパティ

プロパティ説明
request4D.HTTPRequestThe HTTP request

Computed properties

プロパティ説明
successBooleanA Boolean indicating whether the HTTP request was successful.
errorsCollectionReturns a collection of errors. These could be network errors or errors returned by OpenAI.
terminatedBooleanA Boolean indicating whether the HTTP request was terminated.
headersObjectReturns the response headers as an object.
rateLimitObjectReturns rate limit information from the response headers.
効果ObjectReturns usage information from the response body if any.

rateLimit

The rateLimit property returns an object containing rate limit information from the response headers. This information includes the limits, remaining requests, and reset times for both requests and tokens.

For more details on rate limits and the specific headers used, refer to the OpenAI Rate Limits Documentation.

The structure of the rateLimit object is as follows:

フィールド説明
limit.requestIntegerNumber of allowed requests.
limit.tokensIntegerNumber of allowed tokens.
remaining.requestIntegerNumber of remaining requests.
remaining.tokensIntegerNumber of remaining tokens.
reset.request文字列Time until request limit resets.
reset.tokens文字列Time until token limit resets.

関数

throw()

Throws the first error in the errors collection. This function is useful for propagating errors up the call stack.

Inherited Classes

Several classes inherit from OpenAIResult to extend its functionality for specific use cases. Below are some of the classes that extend OpenAIResult: