OpenAIrequest

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.5, Creation date: 2024-11-09, Last change: 2025-09-15

returns the openAI Chat anwer for a single question

Description

if called without an input the function will establish a conversation until "Cntr-C" is used

See Also: jarvisChatSGLib , json2matlab , jsonplansequence , OpenAIcostAPI

Example Illustration

 missing image of OpenAIrequest(Userinp,AIhistory,RequestHistory)

Syntax

[AIansw,AIhistory,RequestHistory]=OpenAIrequest([Userinp,AIhistory,RequestHistory])

Input Parameter

Userinp: A charcter chain as input; default is empty
AIhistory: the struct that is used by addResponseMessage, to maintain a chat history; default ist empty
RequestHistory: a cell list that describes the history of Userinp in case of a conversation

Output Parameter

AIansw: Answer to the last Userinp
AIhistory: AI history of response messages if a conversion is planned
RequestHistory: The history of Userinp if a a conversion is planned

Examples


OpenAIrequest('What is the core diameter of a DIN13 M4 nut') % return a text answer
OpenAIrequest % start a conversation loop




Copyright 2024-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21