Skip to content

Commit

Permalink
Update abstra-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
abstra-bot committed Feb 27, 2024
1 parent 27a3864 commit c82bc2a
Show file tree
Hide file tree
Showing 198 changed files with 392 additions and 392 deletions.
22 changes: 9 additions & 13 deletions abstra_internals/templates/new_form.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import abstra.forms as af
import abstra.workflows as aw

"""
Abstra forms are the simplest way to build user interfaces for your workflows.
"""
# With Abstra Forms, it's easy to build user interfaces
name = af.read("👋 Hello there! What is your name?")

name = af.read("Hello there! What is your name?")
af.display(f"Hello {name}!")
# You can store data in the current thread,
# so it will be available in the next stages
aw.set_data("name", name)

# Different kinds of input and output widgets are available
af.display(f"🎉 Welcome, {name}!")

ans = af.read_multiple_choice("Are you familiar with Abstra?", ["Yes", "No"])

if ans == "Yes":
af.display("Great! Have fun!")
else:
af.display_link(
"https://docs.abstra.io/forms/overview", link_text="Check out the docs!"
)
af.display_markdown("Check out our [docs](https://docs.abstra.io/forms/overview) 📚")
16 changes: 9 additions & 7 deletions abstra_internals/templates/new_hook.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import abstra.hooks as ah
import abstra.workflows as aw

"""
Abstra hooks are the simplest way to build endpoints for your workflows.
"""

# Use Abstra Hooks to create Python endpoints
body, query, headers = ah.get_request()

print("Hook ran!")
print("Received request body:", body)
print("⚙️ Hook is running... received body:", body)

# You can store data in the current thread,
# so it will be available in the next stages
aw.set_data("hook_data", body)

ah.send_json({"message": "Hello world!"})
# You can send a response back to the client after doing some processing
ah.send_json({"message": "A message from the hook!"})
13 changes: 9 additions & 4 deletions abstra_internals/templates/new_job.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"""
Abstra jobs are the simplest way to build repetitive tasks for your workflows. Just schedule a job and let Abstra do the rest.
"""
import abstra.workflows as aw

print("Hello world!")
# Abstra Jobs are a simple way to schedule Python recurring tasks
# Setup the Schedule at the "Settings" tab

print("🕒 Job is running...")

# You can store data in the current thread,
# so it will be available in the next stages
aw.set_data("job_output", "Some data from the job!")
13 changes: 5 additions & 8 deletions abstra_internals/templates/new_script.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""
Abstra scripts are the simplest way to run code in your workflows.
"""
import abstra.workflows as aw

# Use Scripts to run Python code after any workflow Stage

def sum(a, b):
return a, b


print(f"Script ran!")
# You can store data in the current thread,
# so it will be available in the next stages
aw.set_data("script_output", "Some data from the script!")
2 changes: 0 additions & 2 deletions abstra_statics/dist/assets/ApiKeys.25287bcf.js

This file was deleted.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/ApiKeys.48c07e2e.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions abstra_statics/dist/assets/BaseLayout.a39cb2c8.js

This file was deleted.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/BaseLayout.fbcb4976.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/Billing.6a870a72.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions abstra_statics/dist/assets/Billing.edab4d31.js

This file was deleted.

Loading

0 comments on commit c82bc2a

Please sign in to comment.