Find answers from the community

b
beaverTango
·

ragapp

Hi there! I was playing around with the endpoints for ragapp. I can't seem to figure out which endpoint to hit to upload a file.

I tried a curl like so:
Plain Text
curl -X 'POST' \
  'http://localhost:3030/api/management/files' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@3M_2016_10K.pdf;type=application/pdf' \
  -F 'fileIndex=0' \
  -F 'totalFiles=1'

What do I add in the fileIndex and totalFiles if I want to add another 3 files let's say
And there's also another endpoint like:
Plain Text
curl -X 'POST' \
  'http://localhost:3030/api/chat/upload' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "base64": "string",
  "name": "string",
  "params": "string"
}'

and what params are permissible here? it does not seem to accept an empty string
6 comments
b
C
Chris
·

Agents

Hi, can anyone please tell me the difference between an agent and a tool? I mean I understand that an agent uses tools but what got me confused is seeing multi-agent workflows. Why use multi-agent workflows and why not use one agent with different tools?
1 comment
L
Hi there! I can't use my custom prompt with a chat engine.
In this code, how can I set my prompt?
chat_engine = vector_index.as_chat_engine(chat_mode="condense_question") response = chat_engine.chat("Question.... bla bla bla")

In my previous query engine I used:
query_engine = summary_index.as_query_engine(streaming=True, response_mode="tree_summarize", verbose=True, text_qa_template=custom_prompt) query_engine.update_prompts( {"response_synthesizer:summary_template": custom_prompt} )
Thanks!
2 comments
W
s
Hello there. was wondering does query_engine handle going over the maximum context window?

like if you're using gpt-4 with a 8092 context window, and your nodes are over that limit, how does query engine handle that.
2 comments
W
L
N
Nived
·

Image

Hi guys, I am trying to do image reasoning with openai in llama-index. But the 'Image Block' is not being recognized. Can you please help me with this

llama-index version : 0.12.11
Python version: 3.13.1

from llama_index.llms.openai import OpenAI
from llama_index.core.llms import (
ChatMessage,
ImageBlock,
TextBlock,
MessageRole,
)

msg = ChatMessage(
role=MessageRole.USER,
blocks=[
TextBlock(text="Describe the images as an alternative text"),
ImageBlock(url="https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg"),
],
)
openai_llm = OpenAI(model="gpt-4o", max_new_tokens=300)
response = openai_llm.chat(messages=[msg])

this is the block I have been trying

response = openai_llm.chat(messages=[msg])
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/Users/nivedhari/agents/.venv/lib/python3.13/site-packages/certifi/cacert.pem'
DEBUG:openai._base_client:Request options: {'method': 'post', 'url': '/chat/completions', 'files': None, 'json_data': {'messages': [{'role': 'user', 'content': 'Describe the images as an alternative text'}], 'model': 'gpt-4o', 'stream': False, 'temperature': 0.1}}
DEBUG:openai._base_client:Sending HTTP Request: POST https://api.openai.com/v1/chat/completions
DEBUG:httpcore.connection:connect_tcp.started host='api.openai.com' port=443 local_address=None timeout=60.0 socket_options=None

this is the logs of the issue. The Image url is not being included in the content. anyone came across the same issue? Please help
2 comments
L
N
l
llm_dev
·

Workflow

question on AgentWorkflow -> how can i handle parallel agent calls ? like @step(num_workers=3)
5 comments
L
l
@Logan M what's the state of the art for mapping unstructured text to KGs? What have you found most useful/powerful?
5 comments
L
J
This is one example where the code runs successfully at first, but when I run it again after some time in the same virtual environment, the following error occurs:

ERROR:
20
21 # Create embedding model
---> 22 embed_model = OpenAIEmbedding(
23 model="text-embedding-ada-002",
24 # api_key=openai.api_key,
25 # Explicitly specify dimensions
26 )
29 encoded_password = quote_plus(password)

File ~/pgvector/venv/lib/python3.8/site-packages/llama_index/embeddings/openai/base.py:315, in OpenAIEmbedding.init(self, mode, model, embed_batch_size, dimensions, additional_kwargs, api_key, api_base, api_version, max_retries, timeout, reuse_client, callback_manager, default_headers, http_client, async_http_client, num_workers, **kwargs)
307 additional_kwargs["dimensions"] = dimensions
309 api_key, api_base, api_version = self._resolve_credentials(
310 api_key=api_key,
311 api_base=api_base,
312 api_version=api_version,
313 )
--> 315 self._query_engine = get_engine(mode, model, _QUERY_MODE_MODEL_DICT)
316 self._text_engine = get_engine(mode, model, _TEXT_MODE_MODEL_DICT)
...
889 else:
890 # this is the current error
891 raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')

AttributeError: pydantic_private.


can you please help me with, these are the versions that I have been using :

Name: llama-index
Version: 0.10.17
Name: pydantic
Version: 2.10.5
Name: openai
Version: 1.51.2
Name: llama-index-core
Version: 0.11.23
Name: llama-index-vector-stores-supabase
Version: 0.2.0
Name: SQLAlchemy
Version: 2.0.36
python version :3.8.12
hey folks, I am pretty new to LlamaIndex in general, but I was wondering if there was a Reader that takes in a python file object instead of a file path and returns the output? I was looking into the source code for SimpleDirectoryReader and it looks clear enough how to override some functions and create it, but is there any ready made reader or even some idea of what functions I'll need to override for it to work properly? Appreciate any help on this, thanks!
16 comments
W
A
Hello guys,
Does anyone have any idea how to implement Cached Augmented Generation (CAG) with the Gemini?
3 comments
L
A
F
Fremko
·

Docs

it keeps scrolling up to the top every now and then
7 comments
L
F
May be missing it somewhere, but is there a notebook that shows the easiest way to fetch the document id from a node_with_score and return the text from that whole document?
12 comments
L
D
M
MindwhY
·

Turn

When the structured extractor python full stack app from create-llama with the --pro flag, switching use_llama_parse: bool = False to True it seems to through an async error when you try to upload or delete a file

Also, since I'm in here, I'm looking for where I can turn off embedings and just index the markdown
9 comments
L
M
Hello
What should I do when a PDF with selectable text was not extracted correctly?
Thank you
1 comment
W
Hi everyone,
I am a first time user of llama-index. Trying to implement graphrag along with llama-index.
I am getting an AttributeError: 'NoneType' object has no attribute 'context_window' when using "Settings.context_window = 3900" with v 0.12.11. I couldn't find any existing material to resolve it. Any help would be appreciated 🙂
1 comment
L
how do i persist chat history when using the react agent? the docs doesn't mention anything like that. I need the agent to still remember its previous outputs
13 comments
L
4
Hola:LlamaIndex:

How can I use huggingface reranker models for the node postprocessing?

Should I create a custom implementation or is there something ready out of the box like the embedding model where you just insert the model name?
2 comments
L
K
how can I use bm25 retriever with Korean or Japanese ? I received this error, ValueError: ko not recognized. Only English stopwords as default, German, Dutch, French, Spanish, Portuguese, Italian, Russian, Swedish, Norwegian, and Chinese are currently supported. Please input a list of stopwords

likely from the stemmer ?
29 comments
V
L
My windows system reboot today, and out of nowhere, I am now getting this error.

This code hasnt been changed or updated and had been working with no issues until today.
4 comments
L
S
Can i know when chunking using default setting, which part of the nodes are transformed into embedding ?

Is it the nodegetcontent.metadata.embed ?
4 comments
L
V
Hi everyone,

Is it possible to instantiate a SummaryIndex without setting the LLM in the Settings global class? I’m looking for something similar to how it’s done in VectorStoreIndex, where I can pass the embed_model as an argument.

When I use the Settings class, everything works as expected, but this approach isn’t an option for me due to concurrency issues. In my app, I use dependency injection to handle LLM instances.
2 comments
L
c
Hello. I am trying to develop on Azure AI with OpenAI. I have the endpoints and generic setup working. When I try to use AzureAI with llama_index.core it still tries to do directly to an OpenAI service, not the service we have in Azure. I am following along with "Workflows for Advanced Text-2-SQL" and have changed this to llm=AzureOpenAI(...) yet it still wants to go to OpenAI. What am I missing?
3 comments
L
w
Hi everyone,
Is there any implementation of Cached Augmented Generation (CAG) with Gemini or other LLMs integrated with LlamaIndex?
5 comments
L
A
c
cmosguy
·

Storage

I’m seeing a significant slow down when I retrieve a storage connect from disk - is this there simmering I can do to figure out what is doing in here?
5 comments
L
c
Is there a way to write a flexible and complex typesafe multi agent rag using llamaindex ?

Is it using this one ?
https://docs.llamaindex.ai/en/stable/module_guides/workflow/