regent-ai
Version:
An AI multi-agent orchestration framework
25 lines • 835 B
JavaScript
import { AzureOpenAI } from "openai";
const client = new AzureOpenAI({
endpoint: process.env.AZURE_OPENAI_ENDPOINT,
apiVersion: process.env.AZURE_OPENAI_API_VERSION,
apiKey: process.env.AZURE_OPENAI_API_KEY,
});
export async function getChatCompletion({ messages, model = "gpt-4o", tools = [], max_tokens = 2000, temperature = 0.5, tool_choice = "auto", }) {
try {
const chatCompletion = await client.chat.completions.create({
messages,
model,
tools,
max_tokens,
temperature,
parallel_tool_calls: false,
tool_choice,
});
return chatCompletion;
}
catch (error) {
console.error("Error fetching chat completion:", error);
throw error;
}
}
//# sourceMappingURL=ChatCompletionUtils.js.map