But this code using schema-guided extraction fails:
# Schema-Guided Extraction Method
from typing import Literal
from llama_index.core.indices.property_graph import SchemaLLMPathExtractor
# Define the schema for entity types and relationships
entities = Literal["PERSON", "PLACE", "THING"]
relations = Literal["PART_OF", "HAS", "IS_A"]
schema = {
"PERSON": ["HAS", "IS_A"],
"PLACE": ["PART_OF", "HAS"],
"THING": ["IS_A"],
}
# Initialize the schema-based extractor
kg_extractor = SchemaLLMPathExtractor(
llm=llm,
possible_entities=entities,
possible_relations=relations,
kg_validation_schema=schema,
strict=True, # Disallow extractions outside the schema
)
# Construct the property graph index using the schema-guided extractor
index_schema = PropertyGraphIndex.from_documents(
documents,
kg_extractors=[kg_extractor],
vector_store=vector_store,
show_progress=True,
)
AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: c39162c5
**5418. You can find your API key at
https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}
---
It seems like the Settings.llm isn't being applied and is looking for an openai key vs azure openai key?