Saltar al contenido principal
Versión: Siguiente

OpenAIParameters

The OpenAIParameters class is designed to handle execution and request parameters for interacting with the OpenAI API.

Propiedades

Asynchronous Callback Properties

Use this callback property to receive the result regardless of success or error:

PropiedadTipoDescripción
onTerminate
(or formula)
4D.FunctionUna función que se llamará de forma asíncrona cuando termine. Asegúrese de que el proceso actual no termina.

Use these callback properties for more granular control over success and error handling:

PropiedadTipoDescripción
onResponse4D.FunctionA function to be called asynchronously when the request finishes successfully. Asegúrese de que el proceso actual no termina.
onError4D.FunctionA function to be called asynchronously when the request finishes with errors. Asegúrese de que el proceso actual no termina.

The callback function will receive the same result object type (one of OpenAIResult child classes) that would be returned by the function in synchronous code.

See documentation about asynchronous code for examples

Network Properties

PropiedadTipoDescripción
timeoutRealOverrides the client-level default timeout for the request, in seconds. Por defecto es 0.
httpAgentHTTPAgentOverrides the client-level default HTTP agent for the request.
maxRetriesIntegerEl número máximo de reintentos para la petición. (Sólo si el código no es asíncrono, es decir, no se proporciona ninguna función)
extraHeadersObjectEncabezados adicionales para enviar con la petición.

OpenAPI Properties

PropiedadTipoDescripción
userTextA unique identifier representing the end-user, which helps OpenAI monitor and detect abuse.

Others

PropiedadTipoDescripción
throwBooleanSi es true, lanza un error si se produce uno. Sólo si no se ha definido ninguna retrollamada de fórmula.

Clases heredadas

Several classes inherit from OpenAIParameters to extend its functionality for specific use cases. A continuación se muestran algunas de las clases que extienden OpenAIParameters: