This folder contains practical examples of how to use the webidoo-ai-core library.
Before running the examples, make sure to:
-
Install dependencies:
npm install
-
Create a
.envfile in the project root:touch .env
-
Configure environment variables in the
.envfile:OPENAI_API_KEY: Your OpenAI API key
Basic example of using InferenceModel to make a request to OpenAI.
npm run basic-inferenceExample of using streaming to receive real-time responses from OpenAI.
npm run streaming-inferenceExample of using functions (tool calling) with OpenAI, which allows the model to call user-defined functions.
npm run tool-calling-inference- Add Redis integration examples:
- Configure Redis URL in
.envfile:REDIS_URL: Redis connection URL (e.g.,redis://localhost:6379) - Ensure Redis Stack is running with RediSearch support (required only for advanced examples)
- Implement vector search examples using Redis
- Implement vector similarity search examples using Redis
- Configure Redis URL in