Find answers from the community

v
vlad
Offline, last seen 6 days ago
Joined March 11, 2025
Issue with LlamaExtract() (beta)

I'm using LlamaExtract() to structure the output of a claim.

It works when the cache is clear, in a new venv. But it stops working afterwards.

It's asking me for the "name" argument. But when I add it, it's saying that it got an unexpected argument.

Here is what I tried so far:
  • Clear cache, set new venv (it works at 1st attempt)
  • Change value for "name" argument (it doesn't fix it)
  • Remove name (throws argument missing error)
This is the code:

`# Initialize client
extractor = LlamaExtract()

Define schema using Pydantic

class ClaimInfo(BaseModel):
claim_number: str = Field(description="Claim number")
policy_number: str = Field(description="Policy number")
claimant_name: str = Field(description="Claimant name")
date_of_loss: str = Field(description="Date of loss")
loss_description: str = Field(description="Loss description")
estimated_repair_cost: float = Field(description="Estimated repair cost")
property_address: str = Field(description="Property address")
damage_type: str = Field(description="Damage type")
additional_notes: Optional[str] = None


Create extraction agent

agent = extractor.create_agent(
name="claim-parser_10",
data_schema=ClaimInfo,
# extraction_mode="ACCURATE"
)

Extract data from document

result = agent.extract("data/ClaimFiledTemplate.pdf")
print(result.data)``


Here is the error I get when I keep the name configuration:
TypeError: AsyncLlamaExtractClient.create_extraction_agent() got an unexpected keyword argument 'name'"

And when I remove the name configuration,I get this error:
TypeError: LlamaExtract.create_agent() missing 1 required positional argument: 'name'"

-------

Have you encountered this error already ? Any workaround solution ?
2 comments
v
n