Find answers from the community

Home
Members
farzzy528
f
farzzy528
Offline, last seen 4 months ago
Joined September 25, 2024
what am i doing wrong here?
ERROR: ValueError: "MultimodalQueryEngine" object has no field "multi_modal_llm"
10 comments
f
L
running into an issue using AzureAISearchVectorStore here when trying to use this vector store instead of deafult in-memory:
Plain Text
# Define metadata fields mapping
metadata_fields = {
    "doc_id": ("doc_id", MetadataIndexFieldType.STRING),
    "page_num": ("page_num", MetadataIndexFieldType.INT64),
    "image_path": ("image_path", MetadataIndexFieldType.STRING),
    "parsed_text_markdown": ("parsed_text_markdown", MetadataIndexFieldType.STRING),
    "context": ("context", MetadataIndexFieldType.STRING),
}

# Initialize Azure AI Search vector store
vector_store = AzureAISearchVectorStore(
    search_or_index_client=index_client,
    index_name="llamaindex-multimodal-contextual-retreival",
    index_management=IndexManagement.CREATE_IF_NOT_EXISTS,
    id_field_key="id",
    chunk_field_key="parsed_text_markdown",  
    embedding_field_key="embedding",
    embedding_dimensionality=1536,  # Based on embedding model
    metadata_string_field_key="metadata",  # Stores all metadata as a JSON string
    doc_id_field_key="doc_id",
    filterable_metadata_field_keys=metadata_fields,
    language_analyzer="en.lucene",
    vector_algorithm_type="exhaustiveKnn",
)

# Create storage context
storage_context = StorageContext.from_defaults(vector_store=vector_store)

# Build the index
index = VectorStoreIndex.from_documents(
    new_text_nodes,
    storage_context=storage_context,
    llm=llm,
    embed_model=embed_model,
)

Error: AttributeError: 'TextNode' object has no attribute 'get_doc_id'
4 comments
f
L
what exactly does the "cache_control": {"type": "ephemeral"} do?
2 comments
S
in llamaparse how do I use the python client to use my azure openai multimodal model gpt-4o-mini for parsing:
```
from llama_parse import LlamaParse
parser = LlamaParse(
result_type="markdown",
use_vendor_multimodal_model=True,
vendor_multimodal_model_name=""
vendor_multimodal_api_key=""
)
4 comments
f
L
S
I'm following this notebook but using Azure OpenAI as my Settings.llm isntead of OpenAI - currently Azure OpenAI's to my knowledge does NOT support prompt caching. How do I know if it's working here?
https://github.com/run-llama/llama_parse/blob/main/examples/multimodal/multimodal_contextual_retrieval_rag.ipynb?__s=xhybsffemodt4wd1rcub&utm_source=drip&utm_medium=email&utm_campaign=LlamaIndex+Newsletter+2024-10-08
Hi all, im curious as to in LlmaParse why the Claude Sonnet model is more credits then the GPT-4o model?
3 comments
W
S
L
my code to load was working jsut fine in a code sample but now I am seeing this error, please help debug.
Plain Text
import nest_asyncio
from llama_index.core.extractors import TitleExtractor, QuestionsAnsweredExtractor
from llama_index.core.node_parser import TokenTextSplitter

nest_asyncio.apply()

# Configure text splitter
text_splitter = TokenTextSplitter(separator=" ", chunk_size=512, chunk_overlap=128)

# Load documents
documents = SimpleDirectoryReader("data/pdf").load_data()
storage_context = StorageContext.from_defaults(vector_store=vector_store)

# Create index
index = VectorStoreIndex.from_documents(documents, transformations=[text_splitter], storage_context=storage_context)
``

ImportError: llama-index-readers-file package not found
2 comments
L
W
f
farzzy528
·

Top k

how come I specify similarity_topK=3 here but only 2 nodes are being returned?
1 comment
L
I am exploring property graph index.

This code seems to work with Azure OpenAI LLM Settings.
Plain Text
# Property Graph Construction: Implicit Extraction Method
from llama_index.core.indices.property_graph import ImplicitPathExtractor
import nest_asyncio
from llama_index.core import PropertyGraphIndex

# Apply nest_asyncio to avoid runtime errors in async environments
nest_asyncio.apply()

# Initialize Azure AI Search vector store
vector_store = AzureAISearchVectorStore(
    search_or_index_client=index_client,
    index_name=INDEX_NAME,
    index_management=IndexManagement.CREATE_IF_NOT_EXISTS,
    id_field_key="id",
    chunk_field_key="text",
    embedding_field_key="embedding",
    embedding_dimensionality=3072,  # Adjust to match embedding model output (like ada-002)
    metadata_string_field_key="metadata",
    doc_id_field_key="doc_id",
    language_analyzer="en.lucene",
    vector_algorithm_type="exhaustiveKnn",
    compression_type="binary"
)

# Construct the property graph index with implicit path extraction
index = PropertyGraphIndex.from_documents(
    documents,
    llm=llm,
    embed_model=embed_model,
    vector_store=vector_store,
    show_progress=True,
)

I can confirm my vector store in Azure AI SEarch looks correct.
10 comments
f
L
f
farzzy528
·

error:

error:
1 comment
L
I successfully have a property graph index and use azure ai search as a vector store. However, I am a bit confused on what's going on.

Plain Text
import nest_asyncio
from llama_index.core import PropertyGraphIndex

# Apply nest_asyncio to allow nested use of asyncio.run()
nest_asyncio.apply()


# Load documents and create index based on the use_existing_index flag
if use_existing_index:
    storage_context = StorageContext.from_defaults(vector_store=vector_store)
    index = PropertyGraphIndex.from_documents([], storage_context=storage_context)
else:
    # Load documents
    storage_context = StorageContext.from_defaults(vector_store=vector_store)

    # Create index
    index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)


Plain Text
retriever = index.as_retriever(
    include_text=False,  # include source text, default True
)

nodes = retriever.retrieve("What happened at Interleaf and Viaweb?")

for node in nodes:
    print(node.text)
is pyvis suppose tobe a dependency somewhere in llama-index package?
1 comment
L
Hi, just a random feature request. Is it possible to create a an embeddings class for jina.ai to leverage their new "late embeddings" approach via HF? Here is the sample code which still has a bunch of custom methods. https://github.com/jina-ai/late-chunking/tree/main/chunked_pooling

blog: https://jina.ai/news/late-chunking-in-long-context-embedding-models/
4 comments
L
f
AttributeError: type object 'LLMMetadata' has no attribute 'model_fields'

Receiving the above error when using NVIDIA llms library.
8 comments
f
L
Seeing above error message when using
llama-index-embeddings-azure-openai
version 0.2.2

The error message I'm encountering indicates that the azure_ad_token_provider field in the AzureOpenAIEmbedding class expects a callable (i.e., a function), but it's receiving None instead. This is causing the validation to fail. I'm passing in an api_key as I always did, wonder what's wrong here and why it's throwing a vliadation error?

```
llm = AzureOpenAI(
model="gpt-4o",
deployment_name="gpt-4o",
api_key=aoai_api_key,
azure_endpoint=aoai_endpoint,
api_version=aoai_api_version,
)

embed_model = AzureOpenAIEmbedding(
model="text-embedding-ada-002",
deployment_name="text-embedding-ada-002",
api_key=aoai_api_key,
azure_endpoint=aoai_endpoint,
api_version=aoai_api_version,
)
ValidationError: 1 validation error for AzureOpenAIEmbedding
azure_ad_token_provider
Input should be callable [type=callable_type, input_value=None, input_type=NoneType]
3 comments
f
L