-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: allow filtering llama server response fields #10940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also include a guide in the /completion
endpoint section of server's documentation.
Adding test case is optional, but is highly recommended. See an example in examples/server/tests/unit/test_completion.py
When filtering nested response fields, is this new option un-nesting them? In the example provided: curl --request POST \
--url http://localhost:8080/completion \
--header "Content-Type: application/json" \
--data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 128, "response_fields": ["content", "generation_settings/n_predict"]}' {"content":" 1. Choose a domain name...","generation_settings/n_predict":128} It seems like it's changing the previous format of Is this intended or am I misunderstanding somewhere? If it's intended it should probably be mentioned in the docs for the server, since it's a bit confusing behavior for a "filter" to actually change the response format IMO. |
This adds a new feature. Allow Filtering LLama Server Response Fields from #10819.
Usage:
Curl:
Response:
If response does not contain a path, we will return empty json for path.