datastax / astra-assistants-api

Drop in replacement for the OpenAI Assistants API
Apache License 2.0
142 stars 17 forks source link

Retrieval Details #15

Closed phact closed 6 months ago

phact commented 6 months ago

This PR adds retrieval details in Run Steps which can be accessed like so:

class EventHandler(AssistantEventHandler):
    @override
    def on_run_step_done(self, run_step) -> None:
            print("retrieval")
            for tool_call in run_step.step_details.tool_calls:
                print(json.dumps(tool_call.retrieval)

with open_ai_client().beta.threads.runs.create_and_stream(
        thread_id=thread.id,
        assistant_id=assistant_id,
        event_handler=EventHandler(),
) as stream:
     stream.until_done()

It also bumps up the file limits (both for creation and for adding to an assistant) to 1000.

phact commented 6 months ago

green CI https://github.com/datastax/astra-assistants-api/actions/runs/8363961152