This is a small project that shows how you can integrate the Claude or ChatGPT api into your programs.
The main classes can be use in many ways. This example shows how to give the AI access to your programs data / API so it can automate your app and generate reports or do searches.
We do this by adding our programs classes to the msscript control, and then giving the AI access to probe and query it. We have designed a way that the AI can automatically discover our API surface then access it dynamically with javascript.
We use an auto generated dump of our class public prototypes to show whats available. There is a source code parser included to create these dumps by pointing it at the project file. If you wanted to keep some api private from the AI you could modify the parser to add function decorators as comments to omit them.
So, one way to add AI to your app is to build it right in like the above example.
Another way to do it is to make your app externally scriptable so AI can access it.
For this mechanism to work users would have to be running a local AI agent such as claude code, and have the scripting interface of what methods they could call published for the AI to study. The scripting part can be pulled off using the Running Object Table (ROT) and leveraging vb6's native design where almost everything is a COM object by default. The AI then just executes a series of vbs script using GetObject() and figures out on its own how to answer the users question.
I added another class for local ollama access. I was using qwen3:30b, it did ok on the task1, but it didnt handle multiple tasks in one request well. You would have to break up multiple tasks in individual requests I think. It was able to navigate the js object model though. the ollama class also breaks the universal interface a little bit with: ip, model, thinking properties. The qwen model I used does not support vision so I didnt update the image example.