Assistant Return Values#

Using similar steps to Step 4: Call an Assistant, assistants can also be configured to return values back from the assistant.

Once the assistant is configured with outputs, you can call it and receive return values as expected. Each assistant output must be explicitly referenced, in order, on the left-hand side of the assignment operator

from artificial.workflows.decorators import workflow
from artificial.workflows.runtime import show_info
from stubs_assistants import ReturnValAssistant

@workflow('Assistant Return', 'wf_asst_return', 'lab_c9eae09e-ceed-46d1-8390-87ff7dd8586d')
async def asst_return() -> None:

    lot_number, barcode = await ReturnValAssistant.get_lot_number()

    await show_info(f'Lot: {lot_number}, Barcode: {barcode})