Ex. I've had to manually import both of these at the top:
from llama_index.core.base.response.schema import RESPONSE_TYPE, Response
from utils.promptlayer import PromptName, get_prompt_from_promptlayer
logger = logging.getLogger(__name__)
async def run_prompt(nodes, name: PromptName) -> str:
logger.info(f"Running prompt {name}")
start_time = time.time()
index = VectorStoreIndex(nodes=nodes, show_progress=True)
query_engine = index.as_query_engine()
prompt = get_prompt_from_promptlayer(name)
result: RESPONSE_TYPE = await query_engine.aquery(prompt)
typed_response = cast(Response, result)