microsoft / ai-chat-protocol

A library + API spec for easily streaming generative AI output to your chat applications.
MIT License
125 stars 18 forks source link

Allowing endpoints that don't end in '/' #50

Closed glecaros closed 5 months ago

glecaros commented 5 months ago

This pull request makes significant changes to the AIChatProtocolClient class in the sdk/js/packages/client/src/client.ts file. The changes primarily focus on the way URLs are handled within the client. A new function splitURL is introduced to parse the URL into origin and path components. The AIChatProtocolClient constructor and methods are then updated to use these separate components instead of the absolute URL.

URL Handling Changes: