Closed Tachi-67 closed 11 months ago
Hey @Tachi-67,
First off, thanks a ton for this PR! 🚀 I'm really liking the concept of quickly loading API information. What do you think about making the function a bit more versatile? For instance, instead of tying it specifically to the "api_infos" field, we could make it work for other items too. I was thinking of naming the function something like "quick_load." Here's a tweak to the function definition, feel free to adjust:
def quick_load(cfg, item, key="api_infos"):
Also, how about extending its functionality to support nested paths? Imagine a dictionary like this:
{
"something":
{"backend":
{"api_infos": "???"}
},
"backend":
{"api_infos": "???"},
"something else":
{"backend":
{"api_infos": "???"}}
}
If we call quick_load(cfg, "hi", key="something.backend.api_infos")
, it could give us:
{
"something":
{"backend":
{"api_infos": "hi"}
},
"backend":
{"api_infos": "hi"},
"something else":
{"backend":
{"api_infos": "???"}}
}
I think this could be useful if you want to load different api_information for different type of Flows (e.g, you might want to have a different key for flows using Vision than ones using LLMs). This last remark might be a bit of a stretch. Would love to hear your thoughts on whether you think it would be useful
Let me know your take on these suggestions! 😊
Hey @Tachi-67,
First off, thanks a ton for this PR! 🚀 I'm really liking the concept of quickly loading API information. What do you think about making the function a bit more versatile? For instance, instead of tying it specifically to the "api_infos" field, we could make it work for other items too. I was thinking of naming the function something like "quick_load." Here's a tweak to the function definition, feel free to adjust:
def quick_load(cfg, item, key="api_infos"):
Also, how about extending its functionality to support nested paths? Imagine a dictionary like this:
{ "something": {"backend": {"api_infos": "???"} }, "backend": {"api_infos": "???"}, "something else": {"backend": {"api_infos": "???"}} }
If we call
quick_load(cfg, "hi", key="something.backend.api_infos")
, it could give us:{ "something": {"backend": {"api_infos": "hi"} }, "backend": {"api_infos": "hi"}, "something else": {"backend": {"api_infos": "???"}} }
I think this could be useful if you want to load different api_information for different type of Flows (e.g, you might want to have a different key for flows using Vision than ones using LLMs). This last remark might be a bit of a stretch. Would love to hear your thoughts on whether you think it would be useful
Let me know your take on these suggestions! 😊
Hey, thank you for the advise, I really like the point of making the helper more general. I've just done that in the newest version of my commit.
For the second part of the advise, I would actually create another method (that being said, another pr) to configure multiple chat providers to differnent backends, just to make it more clear and separated, instead of adding complexity to the quick_load
method.
Those are brilliant ideas indeed, thanks for the info! ;-)