- Notifications
You must be signed in to change notification settings - Fork1k
Reduce fields insearch_users
response#485
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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.
Pull Request Overview
This PR streamlines thesearch_users
tool output by returning only essential fields (login, ID, profile URL, avatar URL), injects atype:user
filter into the query, and updates the tests to match the new minimal response format.
- Added
MinimalUser
andMinimalSearchUsersResult
types and conversion logic insearch.go
- Automatically prepended
"type:user "
to the search query - Updated test assertions in
search_test.go
to useMinimalSearchUsersResult
and renamed fields
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pkg/github/search.go | Defined minimal response structs, converted full result to minimal, and prefixed"type:user" to queries |
pkg/github/search_test.go | Switched tests to unmarshal intoMinimalSearchUsersResult , updated query expectations and field assertions |
Comments suppressed due to low confidence (2)
pkg/github/search.go:152
- [nitpick] The JSON field
profile_url
diverges from GitHub’s standardhtml_url
; consider renaming the struct field toHTMLURL
withjson:"html_url"
so consumers familiar with the API won’t be surprised.
ProfileURL string `json:"profile_url,omitempty"`
pkg/github/search.go:149
- [nitpick] Add a comment above
MinimalUser
(and similarly forMinimalSearchUsersResult
) to explain its purpose and list which fields are intentionally omitted, improving clarity for future maintainers.
type MinimalUser struct {
Uh oh!
There was an error while loading.Please reload this page.
1495115
to52d0bf0
Compare52d0bf0
to6c70992
Compare@williammartin and@toby I am going ahead with this for reasons I mentioned to Toby last night, but I checked and even if I ask for ordering by follower count we don't get it in the response, so think the published schema is maybe wrong for the search API? Other user APIs might well provide them. |
9dd6fc5
intomainUh oh!
There was an error while loading.Please reload this page.
There is little use in most of the fields returned by the
search_users
function, as they are reproducible easily by knowing the user handle, or not relevant. The profile URL is useful as it encourages the LLM to format the handle as a link, which is good, I think.Here is an example showing that the "missing" data is easily re-constructed by the LLM: