AIU. - Artificial Intelligence Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Model and Endpoint Configuration >

AIU. - Artificial Intelligence Utility

AIU.GetChatEndpoint

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.GetChatEndpoint
Retrieve the Current Chat Endpoint URL

 

Intention

 

GetChatEndpoint Command: Accessing the Current Chat API Endpoint
 
The GetChatEndpoint command retrieves the currently configured URL endpoint used by the AIU system for chat operations, such as AIU.Chat.

This is useful for verifying the endpoint in use or integrating it into your script’s logic.

It’s part of the AIU - OpenAI API suite.

 

What is the GetChatEndpoint Command?

 

The GetChatEndpoint command fetches the current chat endpoint URL, which is set by AIU.SetChatEndpoint or initialized to OpenAI’s default (e.g., https://api.openai.com/v1/chat/completions).

The result can be stored in a variable or, if unspecified, placed on the Top of Stack (TOS).

 

Why Do You Need It?

 

Retrieving the chat endpoint URL is essential for:

Verification: Confirm the endpoint before executing chat operations.

Logging: Record the endpoint in use for debugging or auditing purposes.

Dynamic Behavior: Adjust script logic based on the current endpoint configuration.

 

How to Use the GetChatEndpoint Command?

 

The command accepts an optional parameter to store the retrieved URL.

If no variable is provided, the URL is pushed onto the stack. The default endpoint is set during Init_AIU() unless overridden by AIU.SetChatEndpoint.

 

Example Usage

 

AIU.SetChatEndpoint|https://myproxy.example.com/v1/chat/completions

AIU.GetChatEndpoint|$$URL

DBP.Current Chat Endpoint: $$URL

AIU.GetChatEndpoint

POP.$$URL

 

This example sets a custom endpoint and retrieves it using both a variable and the stack.

 

Illustration

 

┌────────────────────────────┐

│ Chat Endpoint Retrieved    │

├────────────────────────────┤

│ https://myproxy.example.com│

└────────────────────────────┘

Displaying the current chat endpoint URL in use.

 

Syntax

 

AIU.GetChatEndpoint[|P1]

AIU.Get_ChatEndpoint[|P1]

 

Parameter Explanation

 

P1 - (Optional) The variable to store the current chat endpoint URL. If omitted, the URL is placed on the Top of Stack (TOS).

 

Example

 

AIU.SetChatEndpoint|https://local-ai-server:8080/v1/chat

AIU.GetChatEndpoint|$$END

DBP.Current Endpoint: $$END

ENR.

 

Remarks

 

- The returned value is a string representing the full URL of the chat endpoint.

- The default endpoint is set during initialization unless modified by AIU.SetChatEndpoint.

 

Limitations

 

- The command only retrieves the stored URL and does not verify its validity or accessibility.

- More than one parameter triggers an error.

 

See also:

 

AIU.Set_ChatEndpoint

AIU.Chat

AIU.ChatVision

Endpoint Configuration