diff --git a/.gitignore b/.gitignore index 1969786..1fb0d2c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ dist .pypirc examples/notebooks/scratch.py +examples/scratch.py +examples/scratch*.py diff --git a/examples/basic.py b/examples/basic.py index 320f7e7..9e4edc4 100755 --- a/examples/basic.py +++ b/examples/basic.py @@ -10,18 +10,20 @@ if api_key is None: raise EnvironmentError("No SUBSTRATE_API_KEY set") -from substrate import Substrate, GenerateText, sb +from substrate import Substrate, TranscribeMedia -substrate = Substrate(api_key=api_key) +substrate = Substrate(api_key=api_key, timeout=60 * 5) -story = GenerateText({"prompt": "tell me a story"}) +transcribe = TranscribeMedia({"audio_uri": "s3://"}) -summary = GenerateText({"prompt": sb.concat("summarize this story in one sentence: ", story.future.text)}) +# summary = GenerateText({"prompt": sb.concat("summarize this story in one sentence: ", story.future.text)}) -response = substrate.run(story, summary) +response = substrate.run(transcribe) +print(response.api_response.json) +print(response.api_response.status_code) -summary_out = response.get(summary) -print(summary_out.text) +# summary_out = response.get(summary) +# print(summary_out.text) -viz = Substrate.visualize(story, summary) -print(viz) +# viz = Substrate.visualize(ry) +# print(viz) diff --git a/pyproject.toml b/pyproject.toml index b36bae3..02b1edf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "substrate" -version = "120240502.0.0" +version = "120240502.0.1" description = "Substrate Python SDK" readme = "README.md" authors = [ "vprtwn ", "liamgriffiths ",] diff --git a/scripts/sync_version.py b/scripts/sync_version.py index 68ba2a0..b8029c0 100644 --- a/scripts/sync_version.py +++ b/scripts/sync_version.py @@ -10,7 +10,7 @@ def ok(message): print("\033[32m✓\033[0m", message) -SDK_VERSION = "1.0.0" +SDK_VERSION = "1.0.1" # Update version version_path = "substrate/GEN_VERSION" diff --git a/substrate/_client.py b/substrate/_client.py index 83de21e..e4a33cc 100644 --- a/substrate/_client.py +++ b/substrate/_client.py @@ -135,8 +135,8 @@ def __init__( self._base_url = base_url self._backend = backend self._additional_headers = additional_headers - self._client = httpx.Client(timeout=timeout) - self._async_client = httpx.AsyncClient(timeout=timeout) + self._client = httpx.Client(timeout=timeout, follow_redirects=True) + self._async_client = httpx.AsyncClient(timeout=timeout, follow_redirects=True) self._version = __version__ @property