Skip to content
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

Search Code via HTTP API #12

Open
4 tasks
farhoud opened this issue Jul 31, 2024 · 0 comments
Open
4 tasks

Search Code via HTTP API #12

farhoud opened this issue Jul 31, 2024 · 0 comments
Assignees
Labels

Comments

@farhoud
Copy link
Contributor

farhoud commented Jul 31, 2024

Title: Implement Endpoint to Search for Code

Description:
Create an HTTP API endpoint to search for code using human language queries.

Acceptance Criteria:

  • Implement a GET endpoint at /search.
  • The endpoint should accept a query parameter query.
  • Return a list of search results with file names, line numbers, and code snippets.

Request Example:

GET /search?query=function+that+calculates+factorial

Response Example:

{
  "status": "success",
  "results": [
    {
      "file": "utils.py",
      "line": 10,
      "code": "def factorial(n):"
    },
    {
      "file": "math_helpers.py",
      "line": 5,
      "code": "def compute_factorial(number):"
    }
  ]
}

Tasks:

  • Define the /search endpoint.
  • Validate the query parameter.
  • Implement the search functionality.
  • Return a JSON response with the status and results.
@farhoud farhoud self-assigned this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant