Processes a chat completion request by sending messages to a specified completion service.
Delegates to an internal context-isolated function to ensure clean execution.
Array of messages representing the conversation history.
Returns Promise<string>
Async
Example
// Example usage constoutput = awaitchat("openai", [ { role:"system", content:"You are a helpful assistant." }, { role:"user", content:"Hello, how are you?" } ]); console.log(output.content); // Logs the completion output
Processes a chat completion request by sending messages to a specified completion service. Delegates to an internal context-isolated function to ensure clean execution.