The developer created an AI-powered chat widget for websites using Vue 3 and TypeScript, packaged as a web component. The system utilizes the Nitro API, the gpt-5.4-mini model, and a PostgreSQL database with pgvector for data retrieval.

To prevent the AI from hallucinating prices, the model is restricted to selecting predefined UI components such as price lists or calculators. The server fetches actual pricing data based on component IDs, and the Zod library is used to filter out unauthorized fields from the model's output.

The developer implemented a mandatory text response field in the tool schema to ensure the bot provides verbal explanations alongside UI components. Additionally, a server-side filter was introduced to intercept and remove internal function call markup before it reaches the user interface.

The system manages context by limiting the database input to 80 chunks or 40,000 characters to maintain response quality. The bot is programmed to offer a contact form only after four relevant questions are asked, unless the user initiates the request earlier.

Testing procedures were optimized by caching model responses in files using request body hashes to reduce costs and latency. The developer also refined regex patterns to correctly identify Russian language word boundaries, ensuring that automated tests for false positive responses function accurately.