SwiftOpenAI icon indicating copy to clipboard operation
SwiftOpenAI copied to clipboard

Fix issue where path components are discarded for custom URLs

Open provencher opened this issue 1 year ago • 5 comments

Previously, with custom providers, like Fireworks, parts of the path were being discarded preceeding the v1 version tag.

As a result, this meant that many providers would result in 404 errors trying to make api calls.

This fix properly combines all path components when making a request.

provencher avatar Feb 21 '25 21:02 provencher

FYI @jamesrochabrun uses 3 space indent in Xcode. Would make the change clear if indent level stayed the same

lzell avatar Feb 22 '25 02:02 lzell

Ah fair enough. I'm a 4 space kind of guy - 3 is madness.

Just wanted to share the fix for now.

provencher avatar Feb 22 '25 02:02 provencher

Damn this change broke Azure... This URL building setup is insanely obtuse lol

provencher avatar Feb 22 '25 15:02 provencher

Thanks @lzell for the 👀

Damn this change broke Azure... This URL building setup is insanely obtuse lol

@provencher managing different providers (now are so many) may end in not the most cleanest code I agree lol, can you share with me how the request will look like, a curl will be sufficient to see what we can do here :)

Thanks for the PR!

jamesrochabrun avatar Feb 24 '25 20:02 jamesrochabrun

@provencher Bump ⬆️

sindresorhus avatar Mar 31 '25 07:03 sindresorhus