diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 0000000..4f989b3 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index a013669..8fd23c7 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/convect_flow_sdk/flow_algo.py b/convect_flow_sdk/flow_algo.py index aafb3b1..cff787b 100644 --- a/convect_flow_sdk/flow_algo.py +++ b/convect_flow_sdk/flow_algo.py @@ -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() @@ -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") \ No newline at end of file