Skip to main content

Prompting

Text Prompting

from abstra.ai import prompt

ans = prompt("When Python was created?")

Using Files

We currently support PNG (.png), JPEG (.jpeg and .jpg), WEBP (.webp), non-animated GIF (.gif) and PDFs (.pdf) as files.

from abstra.ai import prompt

ans = prompt(["Summarize this document", "./my_doc.pdf"])

Using system instructions

Use the instructions parameter to provide specific guidelines for the AI to follow when responding to the main prompt.

from abstra.ai import prompt

txt = "With Abstra's workflows, it's easy to automate processes"

ans = prompt(
f"Translate this text to portuguese: {txt}",
instructions=["Don't translate the word workflow"]
)