Support spaces and special characters - #3
Merged
Merged
Conversation
- Replace HttpUtility.UrlEncode with Uri.EscapeDataString for path segments - Add comprehensive unit tests for prompt names with spaces - Update XML documentation to indicate support for spaces Co-authored-by: Amitabitbul <2770691+Amitabitbul@users.noreply.github.com>
- Extract mock response creation into helper method - Extract client setup into helper method - Simplify test assertions Co-authored-by: Amitabitbul <2770691+Amitabitbul@users.noreply.github.com>
…-encoding Fix URL encoding for prompt names with spaces in GetPromptAsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves how prompt names and labels are encoded when making API requests in the
LangfuseClient, ensuring correct handling of spaces and special characters. It also updates the documentation to reflect these changes and adds comprehensive unit tests to verify correct encoding behavior.Prompt encoding improvements:
HttpUtility.UrlEncodewithUri.EscapeDataStringfor encoding prompt names and labels inBuildPromptPath, ensuring better handling of spaces and special characters. (src/Langfuse.Client/LangfuseClient.cs, [1] [2]Documentation updates:
GetPromptAsyncand related methods to clarify support for names and labels with spaces and special characters. (src/Langfuse.Client/LangfuseClient.cs, [1] [2]Testing enhancements:
LangfuseClientTests.csto verify correct encoding of prompt names and labels with spaces and special characters, including edge cases. (tests/Langfuse.Client.Tests/LangfuseClientTests.cs, tests/Langfuse.Client.Tests/LangfuseClientTests.csR1-R143)