Skip to content

Commit

Permalink
Merge pull request #2 from convect-ai/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
convect-bot authored Dec 19, 2023
2 parents c7c21d6 + 39c170e commit ba2b994
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Python package publishing
on:
push:
branches:
- main
jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
# retrieve your distributions here

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ pip install convect-flow-sdk
## Usage

```bash
# set up environment variables
# FLOW_WORKSPACE_ID: your flow workspace id
# FLOW_API_TOKEN: your flow api token from the workspace
# FLOW_HOST: flow host, default to https://flow.convect.ai
from convect_flow_sdk import FlowAlgo
from pprint import pprint
# this is an example of how to use the flow_algo_sdk
flow_algo = FlowAlgo()
# this algo_id is will be the one defined in the algo project
Expand Down
5 changes: 3 additions & 2 deletions convect_flow_sdk/flow_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def list_algos(self):
_data = {
"workspace_id": self.flow_workspace_id,
}
r = requests.post(_api_url, headers=self.get_credential_header(), params=pagination)
r = requests.post(_api_url, headers=self.get_credential_header(), params=pagination,json=_data)
print(r.json())
r.raise_for_status()
return r.json()

Expand Down Expand Up @@ -412,4 +413,4 @@ def terminate(self, run_id):
if _run_hash_file["run_id"] == run_id:
os.remove(_file_path)
break
print("terminate algo run successfully")
print("terminate algo run successfully")

0 comments on commit ba2b994

Please sign in to comment.