Open varon opened 5 months ago
Hmm that's a difficult one because here we probably need to flatten the structure we get into a list of RequestPart
s 🤔 the code generator needs to understand that this parameter is a complex structure, then generate code that flattens it when building the parts of the request body. Sorry if this is a bit vague, some of these API are really weird to work with.
Example of how the generated code should look like:
for (part, i) in flatten textPrompts do
yield RequestPart.multipartFormData($"text_prompts[{i}].text", part.text)
yield RequestPart.multipartFormData($"text_prompts[{i}].weight", part.weight)
(The fix for #56 is unrelated to this - FYI)
An example of this is in the stability API, which produces invalid code (compile errors).
config file:
Errors:
I'm not sure how we go about solving this - issue seems to be with their API defining objects in multi-part forms.
You can view an example in their API docs here: https://platform.stability.ai/docs/api-reference#tag/Image-to-Image/operation/imageToImage - see the
text_prompts
parameter.I can give this a bash if you can outline the steps to solve it.