Skip to content

Commit

Permalink
check if version has changed, to avoid error.
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch3712 committed Nov 19, 2024
1 parent 08690be commit c4f7d11
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@ jobs:
- name: Build package
run: poetry build

- name: Check version change
id: check_version
run: |
git fetch origin main
# Extract version from current pyproject.toml
current_version=$(poetry version -s)
# Extract version from main branch pyproject.toml
main_version=$(git show origin/main:pyproject.toml | grep "^version = " | cut -d'"' -f2)
if [ "$current_version" != "$main_version" ]; then
echo "Version changed from $main_version to $current_version"
echo "version_changed=true" >> $GITHUB_OUTPUT
else
echo "Version unchanged"
echo "version_changed=false" >> $GITHUB_OUTPUT
fi
- name: Publish to PyPI
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_version.outputs.version_changed == 'true'
uses: pypa/[email protected]
with:
user: __token__
Expand Down
8 changes: 1 addition & 7 deletions extract_thinker/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,4 @@ def request(self, messages: List[Dict[str, str]], response_model: str) -> Any:
api_version=self.api_version
)

return response

def batch_request(self, batch_requests: List[Dict[str, Any]]) -> str:
return self.batch_client.create_batch(batch_requests)

def retrieve_batch_results(self, batch_id: str) -> BatchResult:
return self.batch_client.get_batch_results(batch_id)
return response

0 comments on commit c4f7d11

Please sign in to comment.