A Python Framework for Building Generative AI Applications#
Gen AI Builder is a Python framework designed to simplify the development of generative AI applications. It offers a set of straightforward, flexible abstractions for working with areas such as Large Language Models (LLMs), Retrieval-Augmented Generation (RAG), and much more.
Technology-agnostic: Gen AI Builder is designed to work with any capable LLM, data store, and backend through the abstraction of Drivers.
Minimal prompt engineering: It’s much easier to reason about code written in Python, not natural languages. Gen AI Builder aims to default to Python in most cases unless absolutely necessary.
Why Consider a Framework?#
If you’re just beginning to experiment with generative AI, it’s often best to start by building simple applications from scratch. However, as your project grows in complexity, a framework like Gen AI Builder can provide structure and best practices that help you maintain clarity and scalability.
Gen AI Builder strives to be transparent about the underlying AI techniques it uses. Nevertheless, having some foundational knowledge of LLMs and related technology will be helpful when building more sophisticated applications.
Prerequisites#
1. OpenAI API Key#
By default, Gen AI Builder uses OpenAI for LLM interactions. We’ll learn how to change this via Prompt Drivers later. For now:
Obtain an OpenAI API key .
Set it as an environment variable:
export OPENAI_API_KEY="your-api-key"
Prompt Drivers are model agnostic, letting you switch out LLM providers without changing application code.
Tip
To securely and easily manage environment variables, check out tools like python-dotenv or mise .
2. Install Gen AI Builder#
Gen AI Builder can be installed via multiple methods. Below are two popular approaches:
Using Uv#
uv is a fast, user-friendly dependency manager. If you’ve
used poetry , uv is a similar project but with a focus on
simplicity and speed.
Install `uv <https://docs.astral.sh/uv/getting-started/installation/>`_ .
Initialize a new project:
uv init griptape-quickstart
Change into the new directory:
cd griptape-quickstart
Add Gen AI Builder as a dependency:
uv add "griptape[all]"
A virtual environment will be automatically created. Activate it:
source .venv/bin/activate
Note
If you use another shell (like fish ), this command may differ.
Tip
If you’re using mise , you can configure it to automatically activate your virtual environment .
Using Pip#
If uv isn’t your style, you can always install Gen AI Builder using
pip :
pip install "griptape[all]" -U
Installing Optional Dependencies#
Gen AI Builder provides optional dependencies that enable specific
features and third-party integrations. If you’re new to Gen AI Builder,
consider installing [all] to unlock its full functionality. This
ensures you have everything you need right from the start.
However, for a more streamlined setup or if you only need certain features, you have two primary options:
Core Dependencies: These provide the minimal, foundational set of libraries for Gen AI Builder to run most default features.
Optional Dependencies: These are additional, vendor-specific drivers (e.g., for Anthropic or Pinecone). Any driver requiring an extra will indicate this in the documentation.
For a core-only installation:
uv add griptape
To install specific optional dependencies such as Anthropic and Pinecone drivers—use:
uv add "griptape[drivers-prompt-anthropic,drivers-vector-pinecone]"
To see all available optional dependencies, see Gen AI Builder’s pyproject.toml .
Prompt Task#
With everything set up, let’s start building! One of Gen AI Builder’s core abstractions is a Prompt Task . We’ll start with a Prompt Task to prompt the LLM with some text.
Create a file named app.py and add:
from griptape.tasks import PromptTask
task = PromptTask()
output = task.run("Hello there!")
print(output)
Then run:
python app.py
Tip
Whenever you see a “Logs” tab in the Gen AI Builder documentation, you can click it to view logs and outputs.
If you got a response from the model, congrats! You’ve created your first generative AI application with Gen AI Builder. This introductory guide sticks to the Prompt Task , but Gen AI Builder supports a wide range of add_tasks(*tasks) . Explore them to see what else you can do.
Changing Models#
Gen AI Builder’s “Prompt Drivers” make switching model providers simple. For instance, to use Anthropic , follow the same steps you used for the OpenAI key, but this time set an Anthropic API key :
export ANTHROPIC_API_KEY="your-api-key"
Then import Anthropic Prompt Driver and pass it to your Task:
from griptape.drivers.prompt.anthropic import AnthropicPromptDriver
from griptape.tasks import PromptTask
task = PromptTask(prompt_driver=AnthropicPromptDriver(model="claude-3-7-sonnet-latest"))
task.run("Hello there!")
Run the script again to see a similar output. Notice you didn’t have to change any of the application-level logic; you only changed the driver.
For the remainder of this guide, we’ll revert to the OpenAI Chat Prompt Driver :
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.tasks import PromptTask
task = PromptTask(prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"))
task.run("Hello there!")
If you’d like to keep using Anthropic, be sure to adjust code accordingly.
Templating#
Gen AI Builder uses the popular Jinja templating engine to help create dynamic prompts. Let’s adapt our Prompt Task to utilize a Jinja template:
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.tasks import PromptTask
task = PromptTask(
input="User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
)
task.run("Hi there!")
Here, {{ args }} is rendered at runtime, allowing you to dynamically
insert data into the prompt.
For static, key-value data, we can add context to our Task:
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.tasks import PromptTask
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
)
task.run("Hi there!")
These two methods allow you to build more versatile, data-driven prompts. Next, we’ll discuss steering the LLM’s output using Gen AI Builder’s Rule system.
Rules#
LLMs can be unpredictable. Getting them to follow specific instructions can be challenging. Gen AI Builder addresses this by providing Rules and Rulesets , which offer a structured approach to steering the model’s output.
For example, we can create a simple Rule that gives the LLM a name:
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.rules import Rule
from griptape.tasks import PromptTask
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rules=[Rule("Your name is Oswald.")],
)
task.run("Hi there, whats your name?")
Tip
While we typically recommend you stick to Rule-based steering, you can always override the system prompt with a custom one. Though pay close attention to the discussed tradeoffs that come with this approach.
Multiple rules can be grouped into Ruleset s. Let’s refactor our
code to use more than one Ruleset:
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.rules import Rule, Ruleset
from griptape.tasks import PromptTask
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
],
),
Ruleset(
name="Behavior",
rules=[
Rule("Introduce yourself at the start of the conversation."),
],
),
],
)
task.run("Hi there!")
Gen AI Builder also includes a specialized Rule, JsonSchemaRule , which inserts a JSON Schema into the system prompt, ensuring the LLM attempts to return structured, machine-readable data:
import json
from typing import TYPE_CHECKING, cast
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.rules import JsonSchemaRule, Rule, Ruleset
from griptape.tasks import PromptTask
if TYPE_CHECKING:
from griptape.artifacts.text_artifact import TextArtifact
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
],
),
Ruleset(
name="Behavior",
rules=[
Rule("Introduce yourself at the start of the conversation."),
],
),
Ruleset(
name="Output Format",
rules=[
JsonSchemaRule(
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"answer": {"type": "string"},
},
"required": ["answer"],
}
)
],
),
],
)
task_output_value = cast("TextArtifact", task.run("Hi there!")).value
print(json.dumps(json.loads(task_output_value), indent=2))
Note
The typing.cast usage is optional, but helps satisfy our type-checker, pyright . We’re actively working to improve Gen AI Builder’s type hints to avoid clunky casts like this.
Now let’s explore an even more robust way to enforce structured outputs.
Structured Output#
While a JsonSchemaRule can encourage the LLM to return structured
data, it doesn’t provide guarantees, especially for complex schemas. For
stronger enforcement, Gen AI Builder’s Prompt Drivers support
Structured Output .
Structured Output uses the LLM provider’s built-in API features to produce outputs in a well-defined schema. It also simplifies parsing, so you can work directly with Python objects rather than manual JSON parsing.
Let’s update our Task to use Structured Output:
from typing import cast
from pydantic import BaseModel
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.rules import Rule, Ruleset
from griptape.tasks import PromptTask
class Output(BaseModel):
answer: str
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
],
),
Ruleset(
name="Behavior",
rules=[
Rule("Introduce yourself at the start of the conversation."),
],
),
],
output_schema=Output,
)
task_output_value = cast("Output", task.run("Hi there!").value)
print(task_output_value.answer)
The LLM response is not only formatted correctly, but automatically parsed into a Python object.
Tip
You can use either pydantic or schema to define your schemas. We recommend pydantic for its ease of use.
Now that we can generate structured responses, let’s make our Task more conversational using Gen AI Builder’s memory features.
Conversation Memory#
By default, each LLM call is stateless. If you want the model to recall previous interactions, use Conversation Memory . It tracks Task run history, providing context for the current run.
from pydantic import BaseModel
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.memory.structure import ConversationMemory
from griptape.rules import Rule, Ruleset
from griptape.tasks import PromptTask
class Output(BaseModel):
answer: str
task = PromptTask(
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
],
),
Ruleset(
name="Behavior",
rules=[
Rule("Introduce yourself at the start of the conversation."),
],
),
],
output_schema=Output,
conversation_memory=ConversationMemory(),
)
task.run("Hi there, my name is Collin!")
task.run("Do you remember my name?")
Tip
You can customize where the conversation is stored by providing a Conversation Memory Drivers .
With that set up, the LLM will now remember our previous exchanges. Let’s move on to enabling the model to perform external actions through Tools.
Tools#
LLMs themselves cannot browse the internet or perform external actions.
You can enable these abilities via Tools . A “Tool” is simply a
Python class, and any method marked with the @activity decorator
becomes available to the LLM.
Gen AI Builder comes with a collection of built-in Tools. Below is an example that uses a web search and scrape Tool:
from pydantic import BaseModel
from rich.pretty import pprint
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.drivers.web_search.duck_duck_go import DuckDuckGoWebSearchDriver
from griptape.memory.structure import ConversationMemory
from griptape.rules import Rule, Ruleset
from griptape.tasks import PromptTask
from griptape.tools import WebScraperTool, WebSearchTool
class Feature(BaseModel):
name: str
description: str
emoji: str
class Output(BaseModel):
answer: str
key_features: list[Feature]
task = PromptTask(
id="project-research",
input="You are speaking to: {{ user_name }}. User said: {{ args[0] }}",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"user_name": "Collin"},
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
Rule("You run Oswalds Open Source, a company for helping people learn about open source."),
],
),
Ruleset(
name="Behavior",
rules=[
Rule("Introduce yourself at the start of the conversation."),
],
),
],
output_schema=Output,
tools=[
WebSearchTool(
web_search_driver=DuckDuckGoWebSearchDriver(),
),
WebScraperTool(),
],
conversation_memory=ConversationMemory(),
)
output = task.run("Tell me about the python framework Griptape.")
pprint(output.value)
Tools are a powerful method for extending the LLM’s capabilities. Consider writing your own Tools to enable more specialized functionality.
At this point, we have a Task that can handle real-world operations. Now let’s look at orchestrating multiple Tasks.
Structures#
So far, we’ve only worked with individual Tasks. As your app becomes more complex, you may want to organize multiple Tasks that execute in sequence or in parallel.
Gen AI Builder provides three Structures:
Agent: A lightweight wrapper around a single
PromptTask. Great for quick usage but still under the hood is just aPromptTask.Pipeline: Executes Tasks in a specific, linear order.
Workflow: Creates highly parallel DAGs , allowing you to fan out and converge Tasks.
Of the three, Workflow is generally the most versatile. Agent
and Pipeline can be handy in certain scenarios but are less
frequently needed if you’re comfortable just orchestrating Tasks
directly.
Let’s place our project-research Task into a Workflow so
multiple Tasks can run in parallel:
from pydantic import BaseModel
from rich.pretty import pprint
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.drivers.web_search.duck_duck_go import DuckDuckGoWebSearchDriver
from griptape.rules import Rule, Ruleset
from griptape.structures import Workflow
from griptape.tasks import PromptTask
from griptape.tools import WebScraperTool, WebSearchTool
class Feature(BaseModel):
name: str
description: str
emoji: str
class Output(BaseModel):
answer: str
key_features: list[Feature]
projects = ["django", "flask", "fastapi", "litestar"]
workflow = Workflow(
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
Rule("You run Oswalds Open Source, a company for helping people learn about open source."),
],
),
],
)
for project in projects:
task = PromptTask(
id=f"project-research-{project}",
input="Tell me about the open source project: {{ project }}.",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"project": project},
output_schema=Output,
tools=[
WebSearchTool(
web_search_driver=DuckDuckGoWebSearchDriver(),
),
WebScraperTool(),
],
)
workflow.add_task(task)
workflow.run()
for output in workflow.outputs:
pprint(output.value)
Directly Using PromptSummaryEngine#
Engines can be used standalone or integrated into Tasks. To illustrate, let’s summarize the outputs of our Workflow:
from pydantic import BaseModel
from griptape.artifacts import ListArtifact
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.drivers.web_search.duck_duck_go import DuckDuckGoWebSearchDriver
from griptape.engines import PromptSummaryEngine
from griptape.rules import Rule, Ruleset
from griptape.structures import Workflow
from griptape.tasks import PromptTask
from griptape.tools import WebScraperTool, WebSearchTool
class Feature(BaseModel):
name: str
description: str
emoji: str
class Output(BaseModel):
answer: str
key_features: list[Feature]
projects = ["django", "flask", "fastapi", "litestar"]
workflow = Workflow(
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
Rule("You run Oswalds Open Source, a company for helping people learn about open source."),
],
),
],
)
for project in projects:
task = PromptTask(
id=f"project-research-{project}",
input="Tell me about the open source project: {{ project }}.",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"project": project},
output_schema=Output,
tools=[
WebSearchTool(
web_search_driver=DuckDuckGoWebSearchDriver(),
),
WebScraperTool(),
],
)
workflow.add_tasks(task)
workflow.run()
summary_engine = PromptSummaryEngine()
summary = summary_engine.summarize_artifacts(ListArtifact(workflow.outputs))
print(summary.value)
This produces a concise summary. But one strength of a Workflow is its
ability to fan out and converge results. Let’s remove the direct
PromptSummaryEngine usage and use a built-in summary Task instead.
TextSummaryTask#
The TextSummaryTask leverages the PromptSummaryEngine behind the
scenes. We’ll have our project-research Tasks converge into one summary
Task:
from pydantic import BaseModel
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.drivers.web_search.duck_duck_go import DuckDuckGoWebSearchDriver
from griptape.rules import Rule, Ruleset
from griptape.structures import Workflow
from griptape.tasks import PromptTask, TextSummaryTask
from griptape.tools import WebScraperTool, WebSearchTool
class Feature(BaseModel):
name: str
description: str
emoji: str
class Output(BaseModel):
answer: str
key_features: list[Feature]
projects = ["django", "flask", "fastapi", "litestar"]
workflow = Workflow(
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
Rule("You run Oswalds Open Source, a company for helping people learn about open source."),
],
),
],
)
for project in projects:
task = PromptTask(
id=f"project-research-{project}",
input="Tell me about the open source project: {{ project }}.",
prompt_driver=OpenAiChatPromptDriver(model="gpt-4.1"),
context={"project": project},
output_schema=Output,
tools=[
WebSearchTool(
web_search_driver=DuckDuckGoWebSearchDriver(),
),
WebScraperTool(),
],
child_ids=["summary"],
)
workflow.add_tasks(task)
workflow.add_task(TextSummaryTask(input="{{ parents_output_text }}", id="summary"))
workflow.run()
print(workflow.output)
Finally, let’s visualize our Workflow:
from pydantic import BaseModel
from griptape.drivers.prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from griptape.drivers.web_search.duck_duck_go import DuckDuckGoWebSearchDriver
from griptape.rules import Rule, Ruleset
from griptape.structures import Workflow
from griptape.tasks import PromptTask, TextSummaryTask
from griptape.tools import WebScraperTool, WebSearchTool
from griptape.utils import StructureVisualizer
class Feature(BaseModel):
name: str
description: str
emoji: str
class Output(BaseModel):
answer: str
key_features: list[Feature]
projects = ["django", "flask", "fastapi", "litestar"]
workflow = Workflow(
rulesets=[
Ruleset(
name="Backstory",
rules=[
Rule("Your name is Oswald."),
Rule("You run Oswalds Open Source, a company for helping people learn about open source."),
],
),
],
)
prompt_driver = OpenAiChatPromptDriver(model="gpt-4.1")
for project in projects:
task = PromptTask(
id=f"project-research-{project}",
input="Tell me about the open source project: {{ project }}.",
prompt_driver=prompt_driver,
context={"project": project},
output_schema=Output,
tools=[
WebSearchTool(
web_search_driver=DuckDuckGoWebSearchDriver(),
),
WebScraperTool(),
],
child_ids=["summary"],
)
workflow.add_tasks(task)
workflow.add_task(TextSummaryTask(input="{{ parents_output_text }}", id="summary"))
print(StructureVisualizer(workflow).to_url())
Visit the printed URL in your logs to view a diagram illustrating the Workflow’s structure:
Workflow Diagram#
Conclusion and Next Steps#
That’s it—you’ve built your first generative AI application with Gen AI Builder, exploring:
Simple and advanced Task usage
Dynamic prompt creation with Jinja templating
Structured output for more reliable data handling
Conversation memory for stateful interactions
Tools for extending LLM capabilities
Parallel Task orchestration with Workflows
Text summarization using Engines
This is just the tip of the iceberg. For topic-based guides, continue exploring the Gen AI Builder documentation. For more detailed guides, demos, and advanced techniques, check out Gen AI Builder Tradeschool .
- Data abstractions
- Prompt
- RAG Engine
- Events
- SDK reference
- artifacts
- Attributes
- to_text()
- Attributes
- attrs_post_init()
- make_name()
- to_bytes(**kwargs)
- to_text()
- Attributes
- bool()
- len()
- str()
- to_bytes(**kwargs)
- to_text()abstractmethod
- Attributes
- to_bytes(**kwargs)
- to_text()
- Attributes
- add(other)
- eq(value)
- parse_bool(value)classmethod
- to_text()
- Attributes
- to_text()
- Attributes
- to_text()
- Attributes
- attrs_post_init()
- make_name()
- to_bytes(**kwargs)
- to_text()
- Attributes
- Attributes
- to_text()
- Attributes
- to_text()
- value_to_json(value)classmethod
- add(other)
- bool()
- getitem(key)
- iter()
- has_items()
- is_type(target_type)
- to_text()
- validatevalue(, value)
- Attributes
- to_text()
- add(other)
- bool()
- generate_embedding(driver)
- to_text()
- token_count(tokenizer)
- Attributes
- to_bytes(*, headers=None, **kwargs)
- Parameters
- Returns
- to_text()
- chunkers
- common
- str()
- from_deltas(deltas)classmethod
- from_deltas(deltas)classmethod
- Attributes
- from_deltas(deltas)classmethod
- Usage
- is_assistant()
- is_system()
- is_user()
- bool()
- len()
- str()
- from_deltas(deltas)abstractmethodclassmethod
- to_text()
- from_deltas(deltas)classmethod
- from_deltas(deltas)classmethod
- init(content, **kwargs)
- str()
- get_content_type(content_type)
- has_all_content_type(content_type)
- has_any_content_type(content_type)
- is_text()
- to_artifact(meta=None)
- to_text()
- Call
- __to_message_content(artifact)
- add_assistant_message(artifact)
- add_message(artifact, role)
- add_system_message(artifact)
- add_user_message(artifact)
- from_artifact(artifact)classmethod
- to_output_json_schema(schema_id=‘Output Format’)
- True})
- configs
- drivers
- Attributes
- client()
- try_embed_chunk(chunk, **kwargs)
- Attributes
- _make_request(request)
- client()
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- __to_bedrock_message_content(content)
- __to_bedrock_messages(messages)
- __to_bedrock_role(message)
- __to_bedrock_tool_use_content(artifact)
- __to_bedrock_tools(tools)
- __to_prompt_stack_delta_message_content(event)
- __to_prompt_stack_message_content(content)
- _base_params(prompt_stack)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestructured_output_strategy(, value)
- Attributes
- _invoke_model(payload)
- client()
- try_embed_artifact(artifact, **kwargs)
- try_embed_chunk(chunk, **kwargs)
- _get_key()
- load()
- store(runs, metadata)
- table()
- Attributes
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- _post_process(meta, records)classmethod
- _process_cells_from_rows_and_columns(columns, rows)classmethod
- _process_columns_from_column_metadata(meta)classmethod
- _process_rows_from_records(records)classmethod
- client()
- execute_query(query)
- execute_query_raw(query)
- get_table_schema(table_name, schema=None)
- validateparams(, workgroup_name)
- Attributes
- _is_a_directory(full_key)
- _list_files_and_dirs(full_key, **kwargs)
- _normpath(path)
- _to_dir_full_key(path)
- _to_full_key(path)
- client()
- try_list_files(path)
- try_load_file(path)
- try_save_file(path, value)
- client()
- try_embed_chunk(chunk, **kwargs)
- __prompt_stack_to_tokens(prompt_stack)
- _base_params(prompt_stack)
- _prompt_stack_to_messages(prompt_stack)
- client()
- prompt_stack_to_string(prompt_stack)
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestream(, stream)
- validatestructured_output_strategy(, value)
- client()
- try_publish_event_payload(event_payload)
- try_publish_event_payload_batch(event_payload_batch)
- Attributes
- __to_anthropic_content(message)
- __to_anthropic_message_content(content)
- __to_anthropic_messages(messages)
- __to_anthropic_role(message)
- __to_anthropic_tool_result_content(artifact)
- __to_anthropic_tools(tools)
- __to_prompt_stack_delta_message_content(event)
- __to_prompt_stack_message_content(content)
- _base_params(prompt_stack)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestructured_output_strategy(, value)
- Attributes
- client()
- collection()
- delete_vector(vector_id)
- Parameters
- load_entries(*, namespace=None)
- Parameters
- Returns
- load_entry(vector_id, *, namespace=None)
- Parameters
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- Parameters
- Returns
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- Parameters
- Returns
- client()
- try_publish_event_payload(event_payload)
- try_publish_event_payload_batch(event_payload_batch)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, offset=None, **kwargs)
- Attributes
- _base_params(prompt_stack)
- client()
- Attributes
- client()
- Attributes
- client()
- Attributes
- client()
- run(*args)
- try_run(*args)abstractmethod
- after_run()
- before_run()
- run(audio, prompts=None)
- try_run(audio, prompts=None)abstractmethod
- _from_params_dict(params_dict)
- _to_params_dict(runs, metadata)
- load()abstractmethod
- store(runs, metadata)abstractmethod
- make_additional_params(negative_prompts, device)abstractmethod
- make_image_param(image)abstractmethod
- prepare_pipeline(model, device)abstractmethod
- Attributes
- attrs_post_init()
- _embed_long_string(string, *, vector_operation=None)
- embed(value, *, vector_operation=None)
- embed_string(string, *, vector_operation=None)
- embed_text_artifact(artifact, *, vector_operation=None)
- try_embed_artifact(artifact, *, vector_operation=None)
- try_embed_chunk(chunk, *, vector_operation=None)abstractmethod
- _safe_publish_event_payload(event_payload)
- _safe_publish_event_payload_batch(event_payload_batch)
- flush_events()
- publish_event(event)
- try_publish_event_payload(event_payload)abstractmethod
- try_publish_event_payload_batch(event_payload_batch)abstractmethod
- Attributes
- list_files(path)
- load_artifact(path)
- load_file(path)
- save_artifact(path, artifact)
- save_file(path, value)
- try_list_files(path)abstractmethod
- try_load_file(path)abstractmethod
- try_save_file(path, value)abstractmethod
- after_run()
- before_run(prompts, negative_prompts=None)
- run_image_inpainting(prompts, image, mask, negative_prompts=None)
- run_image_outpainting(prompts, image, mask, negative_prompts=None)
- run_image_variation(prompts, image, negative_prompts=None)
- run_text_to_image(prompts, negative_prompts=None)
- try_image_inpainting(prompts, image, mask, negative_prompts=None)abstractmethod
- try_image_outpainting(prompts, image, mask, negative_prompts=None)abstractmethod
- try_image_variation(prompts, image, negative_prompts=None)abstractmethod
- try_text_to_image(prompts, negative_prompts=None)abstractmethod
- get_generated_image(response)abstractmethod
- image_inpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)abstractmethod
- image_outpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)abstractmethod
- image_variation_request_parameters(prompts, image, negative_prompts=None, seed=None)abstractmethod
- text_to_image_request_parameters(prompts, image_width, image_height, negative_prompts=None, seed=None)abstractmethod
- Attributes
- enter()
- exit(exc_type, exc_value, exc_traceback)
- get_span_id()abstractmethod
- observe(call)abstractmethod
- Attributes
- __build_message(delta_contents, usage)
- __process_run(prompt_stack)
- __process_stream(prompt_stack)
- _init_structured_output(prompt_stack)
- after_run(result)
- before_run(prompt_stack)
- prompt_stack_to_string(prompt_stack)
- Parameters
- Returns
- run(prompt_input)
- try_run(prompt_stack)abstractmethod
- try_stream(prompt_stack)abstractmethod
- run(query, artifacts)abstractmethod
- Attributes
- _from_ruleset_dict(params_dict)
- _get_rule(value, meta)
- load(ruleset_name)abstractmethod
- RowResultdataclass
- execute_query(query)abstractmethod
- execute_query_raw(query)abstractmethod
- get_table_schema(table_name, schema=None)abstractmethod
- Attributes
- run(*args)
- try_run(*args)abstractmethod
- after_run()
- before_run(prompts)
- run_text_to_audio(prompts)
- try_text_to_audio(prompts)abstractmethod
- Entry
- _get_default_vector_id(value)
- delete_vector(vector_id)abstractmethod
- does_entry_exist(vector_id, *, namespace=None)
- load_artifacts(*, namespace=None)
- load_entries(*, namespace=None)abstractmethod
- load_entry(vector_id, *, namespace=None)abstractmethod
- query(query, *, count=None, namespace=None, include_vectors=False, **kwargs)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- upsert(value, *, namespace=None, meta=None, vector_id=None, **kwargs)
- upsert_collection(artifacts, *, meta=None, **kwargs)
- upsert_text(string, *, namespace=None, meta=None, vector_id=None, **kwargs)
- upsert_text_artifact(artifact, *, namespace=None, meta=None, vector_id=None, **kwargs)
- upsert_text_artifacts(artifacts, *, meta=None, **kwargs)
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)abstractmethod
- extract_page(page)abstractmethod
- fetch_url(url)abstractmethod
- scrape_url(url)
- search(query, **kwargs)abstractmethod
- Attributes
- _request_parameters(prompts, width=None, height=None, image=None, mask=None, negative_prompts=None, seed=None, mask_source=None)
- get_generated_image(response)
- image_inpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)
- image_outpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)
- image_variation_request_parameters(prompts, image, negative_prompts=None, seed=None)
- text_to_image_request_parameters(prompts, image_width, image_height, negative_prompts=None, seed=None)
- Attributes
- _add_common_params(request, width, height, seed=None)
- get_generated_image(response)
- image_inpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)
- image_outpainting_request_parameters(prompts, image, mask, negative_prompts=None, seed=None)
- image_variation_request_parameters(prompts, image, negative_prompts=None, seed=None)
- text_to_image_request_parameters(prompts, image_width, image_height, negative_prompts=None, seed=None)
- Attributes
- client()
- try_embed_chunk(chunk, **kwargs)
- Attributes
- __to_cohere_message_content(content)
- __to_cohere_messages(messages)
- __to_cohere_role(message, message_content=None)
- __to_cohere_tools(tools)
- __to_prompt_stack_delta_message_content(event)
- __to_prompt_stack_message_content(response)
- _base_params(prompt_stack)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- run(query, artifacts)
- client()
- search(query, **kwargs)
- try_run(audio, prompts=None)
- try_embed_chunk(chunk, **kwargs)
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- try_run(prompt_stack)
- try_stream(prompt_stack)
- try_text_to_audio(prompts)
- delete_vector(vector_id)
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- query(query, *, count=None, namespace=None, include_vectors=False, **kwargs)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- upsert_vector(vector, vector_id=None, namespace=None, meta=None, **kwargs)
- client()
- try_text_to_audio(prompts)
- client()
- search(query, **kwargs)
- Attributes
- Optional title for the content. Only works with
retrieval_documenttask type.- _params(chunk)
- try_embed_chunk(chunk, **kwargs)
- Attributes
- __to_google_message_content(content)
- __to_google_messages(prompt_stack)
- __to_google_role(message)
- __to_google_tools(tools)
- __to_prompt_stack_delta_message_content(content)
- __to_prompt_stack_message_content(content)
- _base_params(prompt_stack)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestructured_output_strategy(, value)
- _search_google(query, **kwargs)
- search(query, **kwargs)
- _create_or_find_thread(thread_alias=None)
- _create_run(*args)
- _create_thread(thread_alias=None)
- _find_thread_by_alias(thread_alias)
- _get_run_events(assistant_run_id)
- _get_run_result(assistant_run_id)
- try_run(*args)
- Attributes
- Raises
- _call_api(method, path, json=None, *, raise_for_status=True)
- _get_url(path)
- load()
- store(runs, metadata)
- validateapi_key(, value)
- Attributes
- _get_event_request(event_payload)
- _post_event(json)
- publish_event(event)
- try_publish_event_payload(event_payload)
- try_publish_event_payload_batch(event_payload_batch)
- validateapi_key(, api_key)
- validaterun_id(, structure_run_id)
- Attributes
- Raises
- attrs_post_init()
- _call_api(method, path, json=None, params=None, *, raise_for_status=True)
- _get_asset_url(full_key)
- _get_url(path)
- _is_a_directory(path)
- _to_full_key(path)
- try_list_files(path, postfix=’’)
- try_load_file(path)
- try_save_file(path, value)
- validatebucket_id(, value)
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- build_span_exporter(base_url, api_key, headers, structure_run_id)staticmethod
- format_span_id(span_id)staticmethod
- format_trace_id(trace_id)staticmethod
- get_span_id()
- validaterun_id(, structure_run_id)
- __to_griptape_tools(tools)
- _base_params(prompt_stack)
- try_run(prompt_stack)
- try_stream(prompt_stack)
- Attributes
- Raises
- _call_api(method, path, *, raise_for_status=True)
- _get_url(path)
- load(ruleset_name)
- validateapi_key(, value)
- _create_run(*args)
- _get_run_events(structure_run_id)
- _get_run_result(structure_run_id)
- try_run(*args)
- Attributes
- delete_vector(vector_id)
- load_artifacts(*, namespace=None)
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- query(query, *, count=None, namespace=None, include_vectors=None, distance_metric=None, filter=None, **kwargs)
- upsert_text(string, vector_id=None, namespace=None, meta=None, **kwargs)
- upsert_text_artifact(artifact, namespace=None, meta=None, vector_id=None, **kwargs)
- upsert_vector(vector, vector_id=None, namespace=None, meta=None, **kwargs)
- Attributes
- client()
- try_embed_chunk(chunk, **kwargs)
- Attributes
- __prompt_stack_to_tokens(prompt_stack)
- _base_params(prompt_stack)
- _prompt_stack_to_messages(prompt_stack)
- client()
- prompt_stack_to_string(prompt_stack)
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestructured_output_strategy(, value)
- Attributes
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- Attributes
- __prompt_stack_to_tokens(prompt_stack)
- _base_params(prompt_stack)
- _prompt_stack_to_messages(prompt_stack)
- pipeline()
- prompt_stack_to_string(prompt_stack)
- try_run(prompt_stack)
- try_stream(prompt_stack)
- validatestructured_output_strategy(, value)
- Attributes
- _create_generation(prompts, negative_prompts, init_image_id=None)
- _download_image(url)
- _get_image_url(generation_id)
- _make_api_request(endpoint, request, method=‘POST’)
- _upload_init_image(image)
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- load()
- store(runs, metadata)
- Attributes
- _full_path(path)
- _is_dir(full_path)
- try_list_files(path)
- try_load_file(path)
- try_save_file(path, value)
- run(query, artifacts)
- load(ruleset_name)
- try_run(*args)
- attrs_post_init()
- __namespaced_vector_id(vector_id, *, namespace)
- __save_entries_to_file(json_file)
- delete_vector(vector_id)
- load_entries(*, namespace=None)
- load_entries_from_file(json_file)
- load_entry(vector_id, *, namespace=None)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- Attributes
- extract_page(page)
- fetch_url(url)
- Attributes
- __process_results(results, *, include_vectors)
- client()
- delete_index(name)
- Parameters
- delete_vector(vector_id)
- get_indexes()
- Returns
- load_entries(*, namespace=None)
- Parameters
- Returns
- load_entry(vector_id, *, namespace=None)
- Parameters
- Returns
- query(query, *, count=None, namespace=None, include_vectors=False, include_metadata=True, **kwargs)
- Parameters
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, include_metadata=True, **kwargs)
- Parameters
- Returns
- upsert(value, *, namespace=None, meta=None, vector_id=None, **kwargs)
- Parameters
- Returns
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- Parameters
- Raises
- Returns
- Attributes
- client()
- delete_vector(vector_id)
- get_collection()
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, offset=None, **kwargs)
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- get_span_id()
- observe(call)
- Attributes
- client()
- try_embed_chunk(chunk, **kwargs)
- Attributes
- __to_ollama_message_content(content)
- __to_ollama_role(message, message_content=None)
- __to_ollama_tools(tools)
- __to_prompt_stack_delta_message_content(content_delta)
- __to_prompt_stack_message_content(response)
- _base_params(prompt_stack)
- _prompt_stack_to_messages(prompt_stack)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- EventHandler
- _create_run(thread_id, *args)
- client()
- try_run(*args)
- client()
- try_run(audio, prompts=None)
- Attributes
- __to_openai_message_content(content)
- __to_openai_messages(messages)
- __to_openai_role(message, message_content=None)
- __to_openai_tools(tools)
- __to_prompt_stack_delta_message_content(content_delta)
- __to_prompt_stack_message_content(response)
- _base_params(prompt_stack)
- _to_delta_message_stream(result)
- _to_message(result)
- client()
- try_run(prompt_stack)
- try_stream(prompt_stack)
- Attributes
- _params(chunk)
- client()
- try_embed_chunk(chunk, **kwargs)
- Attributes
- _build_model_params(values)
- Parameters
- _parse_image_response(response, prompt)
- client()
- try_image_inpainting(prompts, image, mask, negative_prompts=None)
- try_image_outpainting(prompts, image, mask, negative_prompts=None)
- try_image_variation(prompts, image, negative_prompts=None)
- try_text_to_image(prompts, negative_prompts=None)
- validate_image_size(attribute, value)
- client()
- try_text_to_audio(prompts)
- Attributes
- client()
- delete_vector(vector_id)
- load_entries(*, namespace=None)
- Returns
- load_entry(vector_id, *, namespace=None)
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, include_metadata=True, field_name=‘vector’, **kwargs)
- Returns
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- attrs_post_init()
- enter()
- exit(exc_type, exc_value, exc_traceback)
- _trace_provider_factory()
- get_span_id()
- observe(call)
- _base_params(prompt_stack)
- _to_message(result)
- prompt_driver()
- search(query, **kwargs)
- delete_vector(vector_id)
- engine()
- load_artifacts(*, namespace=None)
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- query(query, *, count=BaseVectorStoreDriver.DEFAULT_QUERY_COUNT, **kwargs)
- upsert_text(string, vector_id=None, namespace=None, meta=None, **kwargs)
- upsert_text_artifact(artifact, namespace=None, meta=None, vector_id=None, **kwargs)
- upsert_vector(vector, vector_id=None, namespace=None, meta=None, **kwargs)
- Attributes
- default_vector_model()
- delete_vector(vector_id)
- engine()
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, distance_metric=‘cosine_distance’, **kwargs)
- setup(*, create_schema=True, install_uuid_extension=True, install_vector_extension=True)
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
- validateconnection_string(, connection_string)
- client()
- delete_vector(vector_id)
- index()
- load_entries(*, namespace=None)
- load_entry(vector_id, *, namespace=None)
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, include_metadata=True, **kwargs)
- upsert_vector(vector, vector_id=None, namespace=None, meta=None, **kwargs)
- extract_page(page)
- fetch_url(url)
- client()
- try_publish_event_payload(event_payload)
- try_publish_event_payload_batch(event_payload_batch)
- Attributes
- client()
- delete_vector(vector_id)
- Parameters
- load_entries(*, namespace=None, **kwargs)
- Parameters
- Returns
- load_entry(vector_id, *, namespace=None)
- Parameters
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- Parameters
- Returns
- upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, content=None, **kwargs)
- Parameters
- Returns
- Attributes
- load()
- store(runs, metadata)
- Attributes
- _generate_key(vector_id, namespace=None)
- _get_doc_prefix(namespace=None)
- client()
- delete_vector(vector_id)
- load_entries(*, namespace=None)
- Returns
- load_entry(vector_id, *, namespace=None)
- Returns
- query_vector(vector, *, count=None, namespace=None, include_vectors=False, **kwargs)
- Returns
- upsert_vector(vector, vector_id=None, namespace=None, meta=None, **kwargs)
- engine()
- execute_query(query)
- execute_query_raw(query)
- get_table_schema(table_name, schema=None)
- validateget_connection(, get_connection)
- _get_table_schema(engine, table_name, schema=None)cachedstaticmethod
- engine()
- execute_query(query)
- execute_query_raw(query)
- get_table_schema(table_name, schema=None)
- Attributes
- make_additional_params(negative_prompts, device)
- make_image_param(image)
- prepare_pipeline(model, device)
- Attributes
- make_additional_params(negative_prompts, device)
- make_image_param(image)
- prepare_pipeline(model, device)
- Attributes
- make_additional_params(negative_prompts, device)
- make_image_param(image)
- prepare_pipeline(model, device)
- client()
- search(query, **kwargs)
- extract_page(page)
- fetch_url(url)
- Attributes
- client()
- try_embed_artifact(artifact, **kwargs)
- try_embed_chunk(chunk, **kwargs)
- try_publish_event_payload(event_payload)
- try_publish_event_payload_batch(event_payload_batch)
- engines
- events
- exceptions
- loaders
- try_parse(data)
- fetch(source)
- save(destination, artifact)
- Attributes
- fetch(source)abstractmethod
- load(source)
- load_collection(sources)
- parse(data)
- to_key(source)
- try_parse(data)
- try_parse(data)
- try_parse(data)
- EmailQuery
- Attributes
- _count_messages(message_numbers)
- fetch(source)
- try_parse(data)
- Attributes
- try_parse(data)
- parse(data)
- try_parse(data, *, password=None)
- fetch(source)
- parse(data)
- try_parse(data)
- fetch(source)
- try_parse(data)
- memory
- mixins
- observability
- rules
- schemas
- Meta
- _get_field_for_type(field_type, serialization_key=None, types_overrides=None)classmethod
- Parameters
- _get_field_type_info(field_type)classmethod
- Parameters
- _handle_list(list_type, *, optional, serialization_key=None)classmethod
- Parameters
- Returns
- _handle_union(union_type, *, optional, serialization_key=None)classmethod
- Parameters
- Returns
- _is_enum(field_type)classmethod
- _is_list_sequence(field_type)classmethod
- _is_union(field_type)classmethod
- _resolve_types(attrs_cls, types_override=None)classmethod
- Parameters
- from_attrs_cls(attrs_cls, *, types_overrides=None, serializable_overrides=None)classmethod
- Parameters
- _deserialize(value, attr, data, **kwargs)
- _serialize(value, attr, obj, **kwargs)
- _validate(value)
- init(inner_class, types_overrides=None, **kwargs)
- _dump(obj, *, update_fields=True, **kwargs)
- _load(data, *, partial=None, unknown=None, **kwargs)
- dump(obj, *, many=None, **kwargs)
- get_data_type(data)
- get_obj_type(obj)
- load(data, *, many=None, partial=None, unknown=None, **kwargs)
- validate(data, *, many=None, partial=None)
- _deserialize(value, attr, data, **kwargs)
- _serialize(value, attr, obj, **kwargs)
- Parameters
- init(fields, *, reverse_serialize_candidates=False, **kwargs)
- _deserialize(value, attr=None, data=None, **kwargs)
- Parameters
- Raises
- _serialize(value, attr, obj, **kwargs)
- Parameters
- Raises
- structures
- attrs_post_init()
- _init_task()
- add_task(task)
- add_tasks(*tasks)
- try_run(*args)
- validatefail_fast(, fail_fast)
- validateprompt_driver(, prompt_driver)
- validatetasks(, tasks)
- __run_from_task(task)
- add_task(task)
- context(task)
- insert_task(parent_task, task)
- try_run(*args)
- add(other)
- attrs_post_init()
- add_task(task)abstractmethod
- add_tasks(*tasks)
- after_run()
- before_run(args)
- context(task)
- find_task(task_id)
- is_finished()
- is_running()
- resolve_relationships()
- run(*args)
- run_stream(*args, event_types=None)
- try_find_task(task_id)
- try_run(*args)abstractmethod
- __link_task_to_children(task, child_tasks)
- __link_task_to_parents(task, parent_tasks)
- __remove_old_parent_child_relationships(parent_tasks, child_tasks)
- add_task(task)
- context(task)
- insert_task(parent_tasks, task, child_tasks, *, preserve_relationship=False)
- insert_tasks(parent_tasks, tasks, child_tasks, *, preserve_relationship=False)
- Parameters
- order_tasks()
- to_graph()
- try_run(*args)
- tasks
- __init_from_artifact(artifact)
- Parameters
- Returns
- __init_from_prompt(value)
- __parse_actions(actions_matches)
- __process_action_object(action_object)
- __validate_action(action)
- _process_task_input(task_input)
- actions_to_dicts()
- actions_to_json()
- add_to_prompt_stack(stack)
- after_run()
- attach_to(parent_task)
- before_run()
- default_generate_assistant_subtask_template(subtask)
- default_generate_user_subtask_template(subtask)
- run_action(action)
- run_actions(actions)
- try_run()
- Attributes
- try_run()
- try_run()
- after_run()
- before_run()
- Attributes
- _get_negative_prompts()
- _get_prompts(prompt)
- _read_from_file(path)
- add_child(child)
- add_parent(parent)
- add_to_prompt_stack(stack)abstractmethod
- attach_to(parent_task)
- State
- attrs_post_init()
- lshift(other)
- rshift(other)
- str()
- add_child(child)
- add_children(children)
- add_parent(parent)
- add_parents(parents)
- after_run()
- before_run()
- can_run()
- is_finished()
- is_pending()
- is_running()
- is_skipped()
- preprocess(structure)
- reset()
- run(*args)
- try_run()abstractmethod
- after_run()
- before_run()
- try_run()
- try_run()
- try_run()
- Attributes
- try_run()
- Attributes
- try_run()
- add_to_prompt_stack(stack)
- after_run()
- attach_to(parent_task)
- before_run()
- default_generate_assistant_subtask_template(subtask)
- default_generate_user_subtask_template(subtask)
- try_run()
- Attributes
- try_run()
- attrs_post_init()
- _process_task_input(task_input)
- actions_schema()
- add_subtask(subtask)
- after_run()
- before_run()
- default_generate_assistant_subtask_template(subtask)
- defaultgenerate_system_template()
- default_generate_user_subtask_template(subtask)
- default_run_actions_subtasks(subtask_input)
- default_run_output_schema_validation_subtasks(subtask_input)
- find_memory(memory_name)
- find_subtask(subtask_id)
- find_tool(tool_name)
- preprocess(structure)
- set_default_tools_memory(memory)
- try_run()
- validateoutput_schema(, output_schema)
- validatetools(, tools)
- try_run()
- Attributes
- _process_task_input(task_input)
- try_run()
- try_run()
- try_run()
- attrs_post_init()
- actions_schema()
- add_subtask(subtask)
- defaultgenerate_system_template()
- find_memory(memory_name)
- find_subtask(subtask_id)
- find_tool(tool_name)
- preprocess(structure)
- set_default_tools_memory(memory)
- try_run()
- try_run()
- Attributes
- try_run()
- tokenizers
- count_tokens(text)
- count_tokens(text)
- attrs_post_init()
- _default_max_input_tokens()
- _default_max_output_tokens()
- count_input_tokens_left(text)
- count_output_tokens_left(text)
- count_tokens(text)abstractmethod
- max_input_tokens()
- max_output_tokens()
- count_tokens(text)
- count_tokens(text)
- client()
- count_tokens(text)
- count_tokens(text)
- count_tokens(text)
- _default_max_input_tokens()
- _default_max_output_tokens()
- count_tokens(text, model=None)
- count_tokens(text)
- count_tokens(text)
- tools
- transcribe_audio_from_disk(params)
- transcribe_audio_from_memory(params)
- Attributes
- attrs_post_init()
- activity_schemas()
- after_run(activity, subtask, action, value)
- are_requirements_met(requirements_path)
- before_run(activity, subtask, action)
- find_input_memory(memory_name)
- install_dependencies(env=None)
- run(activity, subtask, action)
- schema()
- to_native_tool_name(activity)
- Parameters
- Returns
- tool_dir()
- try_run(activity, subtask, action, value)
- validate()
- validateoutput_memory(, output_memory)
- calculate(params)
- attrs_post_init()
- del()
- build_image(tool)
- container_name(tool)
- default_docker_client()
- dependencies()
- execute_code(params)
- execute_code_in_container(filename, code)
- execute_command(params)
- execute_command_in_container(command)
- image_name(tool)
- install_dependencies(env=None)
- remove_existing_container(name)
- validatedocker_client(, docker_client)
- add_timedelta(timedelta_kwargs, iso_datetime=None)
- get_current_datetime()
- get_datetime_diff(start_datetime, end_datetime)
- get_relative_datetime(params)
- Attributes
- _create_smtp_client(smtp_host, smtp_port)
- retrieve(params)
- send(params)
- Attributes
- extract(params)
- Attributes
- list_files_from_disk(params)
- load_files_from_disk(params)
- save_content_to_file(params)
- save_memory_artifacts_to_disk(params)
- Attributes
- attrs_post_init()
- __extract_schema_from_ref(schema, schema_ref)
- _create_activity_handler(activity_name, description, activity_schema)
- _get_schema()
- _init_activities()
- _map_openapi_type_to_python(openapi_type, schema_info=None)
- _parse_schema(schema)
- _run_activity(activity_name, params)
- query_image_from_disk(params)
- query_images_from_memory(params)
- Attributes
- _generate_inpainting(prompt, negative_prompt, image_artifact, mask_artifact)
- image_inpainting_from_file(params)
- image_inpainting_from_memory(params)
- Attributes
- _generate_outpainting(prompt, negative_prompt, image_artifact, mask_artifact)
- image_outpainting_from_file(params)
- image_outpainting_from_memory(params)
- Attributes
- generate_image(params)
- Attributes
- summarize(params)
- query(params)
- Attributes
- search(params)
- Attributes
- _build_url(base_url, path=None, path_params=None)
- delete(params)
- get(params)
- patch(params)
- post(params)
- put(params)
- execute_query(params)
- Attributes
- run_structure(params)
- provide_output(params)
- Attributes
- text_to_speech(params)
- Attributes
- _generate_variation(prompt, negative_prompt, image_artifact)
- image_variation_from_file(params)
- image_variation_from_memory(params)
- Attributes
- search(params)
- get_content(params)
- search(values)
- utils
- Attributes
- ChatPrompt
- _call_handle_output(text, *, stream=False)
- _has_streaming_tasks()
- default_handle_input(prompt_prefix)
- default_handle_output(text, *, stream=False)
- start()
- run(command)
- str()
- lines()
- prompt_stack()
- validate_memory(attribute, value)
- Attributes
- enter()
- exit(exc_type, exc_value, exc_traceback)
- _to_artifact(value)
- event_listener()
- observability()
- render(**kwargs)
- render_from_string(value, **kwargs)
- schema()
- validate(manifest)
- run(code)
- Attributes
- run(*args)
- __render_task(task)
- __render_tasks(tasks)
- to_url()
- Returns
- add_tokens(new_tokens)
- Parameters
- Parameters
- Parameters
- Returns
- Parameters
- Parameters
- Returns
- Parameters
- Returns
- Parameters
- artifacts
- Agents
- Tools in Gen AI Builder