From 501fee7bc79217d042a6d64a815a945d5d7f834c Mon Sep 17 00:00:00 2001 From: Jithin James Date: Sun, 26 Jan 2025 16:27:59 -0800 Subject: [PATCH] chore: added openhands for solving some github issues (#1884) Co-authored-by: Jithin James --- .github/workflows/openhands.yml | 32 ++++++++++++++++++++++++++++++++ src/ragas/dataset_schema.py | 4 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/openhands.yml diff --git a/.github/workflows/openhands.yml b/.github/workflows/openhands.yml new file mode 100644 index 000000000..8ebb451ca --- /dev/null +++ b/.github/workflows/openhands.yml @@ -0,0 +1,32 @@ +name: Resolve Issue with OpenHands + +on: + issues: + types: [labeled] + pull_request: + types: [labeled] + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + pull_request_review: + types: [submitted] + +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + call-openhands-resolver: + uses: All-Hands-AI/OpenHands/.github/workflows/openhands-resolver.yml@main + with: + macro: ${{ vars.OPENHANDS_MACRO || '@openhands-agent' }} + max_iterations: ${{ fromJson(vars.OPENHANDS_MAX_ITER || 50) }} + base_container_image: ${{ vars.OPENHANDS_BASE_CONTAINER_IMAGE || '' }} + LLM_MODEL: ${{ vars.LLM_MODEL || 'anthropic/claude-3-5-sonnet-20241022' }} + secrets: + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + PAT_USERNAME: ${{ secrets.PAT_USERNAME }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} diff --git a/src/ragas/dataset_schema.py b/src/ragas/dataset_schema.py index 04fe7f2e1..f59782e63 100644 --- a/src/ragas/dataset_schema.py +++ b/src/ragas/dataset_schema.py @@ -191,7 +191,9 @@ def validate_samples(self, samples: t.List[Sample]) -> t.List[Sample]: first_sample_type = type(samples[0]) for i, sample in enumerate(samples): if not isinstance(sample, first_sample_type): - raise ValueError(f"Sample at index {i} is of type {type(sample)}, expected {first_sample_type}") + raise ValueError( + f"Sample at index {i} is of type {type(sample)}, expected {first_sample_type}" + ) return samples