Python extract method recreates Needle

#3
by Zambonilli - opened

I'm trying to do bulk extractions using the python module. However, I'm seeing the implementation of extract create a new Needle and autoclose the needle instance on each call to an already constructed Needle instance.

Switching to constructing the Needle instance with my pydantic model as a tool and running complete followed by reset, nearly halves the response time of running my batch.

I get wanting an easy acessor for extract but is there a way to update the instance extract method to reuse an already constructed instance?

Sign up or log in to comment