AIOBJECT


Instructions Methods Events

 

The AIOBJECT object provides server side access to the OpenAI and Gemini AI models. This will allow PL/B applications to perform data analysis, text/image/audio generation, analyze images, and analyze files, and The declaration syntax of a AIOBJECT object is as follows:

 

(1)

[label]

AIOBJECT

[%|^][(arraysize)]

(2)

[label]

AIOBJECT

^,{target}

(3)

[label]

AIOBJECT

^(arraysize),({target}),...,({target})

 

Where:

label

Optional. A Data Label.

%

Optional. Denotes the item as being GLOBAL.

arraysize

Required. An integer decimal constant, CONST variable, or EQUATEd value indicating the number of array items.

^

Optional. Denotes the item as being a POINTER.

target

Required. The name of a previously defined data item of the same type.

Flags Affected: NONE

 

Instructions:

 

Object instructions are PL/B verbs that support the graphical objects.

 

DESTROY

Release the data structures obtained for an object.

EVENTREGISTER

Associates an event with a program execution label.

 

Methods:

 

Methods are encapsulated routines that act upon an object.

 

 Initialize,

Create a runtime Web View AI thread

Question

Make an inquiry to an OpenAI or Gemini model

 Response

Obtains the returned JSON data from last successful OpenAI or Gemini AI operation

 

Events:

 

Events are actions recognized by an object for which you can write code to respond. Events can occur as a result of a user action or program code, or they can be triggered by the system.

 

 Answer

Indicates a result is available from a successful Question method

 

Note the following:

  1. The AIOBJECT object is implicitly created when a method is executed.

  2. The AIOBJECT object can be used in a DESTROY instruction.

  3. Requires a runtime that contains WebView2 support. The supported executables are plbwin.exe, plbcon.exe, plbwebsrva.exe, and plbservera.exe.

  4. Support files are located in plbai_html directory and must be located in the same directory as the runtime command.:

 

See Also: Object Definitions, Object I/O Instructions, Method Syntax

 



PL/B Language Reference