golang / oscar

[mirror] Open source contributor agent architecture repo.
BSD 3-Clause "New" or "Revised" License
148 stars 19 forks source link

design and deploy related entities API #22

Open tatianab opened 2 months ago

tatianab commented 2 months ago

Design and deploy an API that returns entities (issues, docs, etc) that are related to the given document. Consider allowing the following parameters/filters:

jba commented 1 month ago

Suggested design of the API:

Endpoint POST /api/search?threshold=T&limit=L Threshold is the lowest score to return, assuming the max score is 1 and the min is 0. Limit is the max number of results to return.

The post body is the JSON for the EmbedDoc struct:

 type EmbedDoc struct {
        Title string // title of document
        Text  string // text of document
  }

This is the search query, which may itself be some document (like a GitHub issue).

The response is the JSON for this Go:

[]SearchResult

type SearchResult struct {
    Kind string // type of result, e.g. "GerritCL", "GitHubIssue", etc.
    ID string    // always a URL, for now
    Score float64
}

Responses are by decreasing score.

Notes: