[FEATURE] allow for Field
, Question
and Settings
initialisation without Argilla
initialisation
#5780
Labels
type: enhancement
Indicates new feature requests
Is your feature request related to a problem? Please describe.
I want to define certain things in code like Fields, Questions or Settings, e.g.
However, when this code is executed (even through an import of this file), it fails, if I didn't create a proper connection to a running argilla client first. I'm getting an error on the import of snippet from above, because argilla tries to set up a default client as part of the TextField instantiation and if I don't have the environment variable for api key set, I'm running into ArgillaError("Missing api_key. You must provide a valid API key."). Even if I were to set the environment variable, it would still try to make the connection to that instance. In my opinion, initialization itself shouldn't have this requirement.
Describe the solution you'd like
I think the classes that define data / structure like the ones mentioned above, should be refactored to not require a running connection at initialization. Only once they interact with a client (e.g. because they read or write something from or to the client), should there be a running connection required.
Describe alternatives you've considered
I ended up, delaying the initialization to runtime, when any code making use of that is actually called (see below). That did the trick for me but seems a bit cumbersome.
Additional context
I'm trying to write a small CLI tool to interact with argilla programmatically, which also does other things (like notifying people about new data).
The text was updated successfully, but these errors were encountered: