Skip to content

Check if given text is still relevant to given comments.

License

Notifications You must be signed in to change notification settings

theztd/contextoid

Repository files navigation

Contextoid

Check if given text is still relevant to given comments and marks comments that changing context.

Quick start

  1. Generate API Token in your chatGPT
  2. Put this token into .env file
  3. Run development server or generated binary

Run development server

go run ./cmd/

Example

  1. Sent example data to api
curl -X POST http://localhost:8080/v1/gpt/analyze_comments \
    --header "Content-Type: application/json" \
    -d @data.json

data.json

{
  "task_text": "Implement the API for handling user comments.",
  "comments": [
    "I think we need to add error handling.",
    "This API should support authentication.",
    "The API must integrate with a third-party service for notifications.",
    "Update the documentation to reflect recent changes.",
    "The API must handle 5000 requests per second.",
    "Can we discuss the timeline for this task? It seems unclear.",
    "This is unrelated to the API development and should be handled separately."
  ]
}
  1. Response should look like this
{
  "Data": {
    "comments_analysis": [
      {
        "changes_scope": true,
        "comment_id": 1
      },
      {
        "changes_scope": true,
        "comment_id": 2
      },
      {
        "changes_scope": true,
        "comment_id": 3
      },
      {
        "changes_scope": true,
        "comment_id": 4
      },
      {
        "changes_scope": true,
        "comment_id": 5
      },
      {
        "changes_scope": false,
        "comment_id": 6
      },
      {
        "changes_scope": false,
        "comment_id": 7
      }
    ],
    "new_description": "Implement the API for handling user comments. The API should support authentication, add error handling, and handle 5000 requests per second. The API must integrate with a third-party service for notifications. After all updates, the documentation needs to be updated to reflect the changes."
  },
  "Usage": {
    "completion_tokens": 213,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens": 261,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 0
    },
    "total_tokens": 474
  },
  "finish_reason": "stop"
}

About

Check if given text is still relevant to given comments.

Resources

License

Stars

Watchers

Forks

Packages

No packages published