MarketSquare / robotframework-ai

Apache License 2.0
10 stars 2 forks source link

Issue: module attributes get overwritten #9

Closed StijnDeJong closed 3 months ago

StijnDeJong commented 3 months ago

The library inherits 3 classes that all inherit from the module interface. When you import the library, you can't specify which module you want to use, instead it combines them all. Because of this, the attributes in the module interface are the same for each module. So if 2 module have the same attribute but different value, the module imported first determines, the value of that attribute for all other modules.

One such attribute is ai_tool. This parameter determines to what type of tool should handle the prompt. For the RealTestDataGenerator this attribute is always text_generator. For the Assistant this attribute is always assistant. Because the RealTestDataGenerator is imported first, the Assistant unintentionally has this attribute set to text_generator aswell. This made the interface think it should route the prompt to the text generator instead of the assistant.

StijnDeJong commented 3 months ago

Using the DynamicCore from the PythonLibCore library, this issue is now fixed!