Bobster2002
04/07/2026, 7:43 AMAI Evy
04/07/2026, 7:44 AMAI Evy
04/07/2026, 7:44 AMtypescript
import {
OpenAIClient,
AzureKeyCredential,
ChatRequestMessage,
GetChatCompletionsOptions,
} from "@azure/openai";
import { WebSocket } from "ws";
You'll need to create a class that handles the LLM connection:
typescript
export class DemoLlmClient {
private client: OpenAIClient;
constructor() {
this.client = new OpenAIClient(
process.env.AZURE_OPENAI_ENDPOINT,
new AzureKeyCredential(process.env.AZURE_OPENAI_KEY) ,
) ;
}
For Python (with FastAPI) :
Python examples with OpenAI are available in the demo repository.
You can customize the prompt, use different LLM providers, add RAG, implement internal states, or create dynamic prompts as needed.
Check out the demo repos for more examples:
- Node.js: [Azure OpenAI]() , [OpenAI]() , [OpenRouter]()
- Python: [OpenAI]()AI Evy
04/07/2026, 7:44 AMAI Evy
04/07/2026, 7:44 AM