Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

120240502.0.1 #10

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ dist
.pypirc

examples/notebooks/scratch.py
examples/scratch.py
examples/scratch*.py
20 changes: 11 additions & 9 deletions examples/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>", "liamgriffiths <[email protected]>",]
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions substrate/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading