Find answers from the community

A
Andrei
Offline, last seen 3 months ago
Joined September 25, 2024
Hello, I want to query directly the llm, any advice on how can I configure system prompt?

Plain Text
from llama_index.llms.openai import OpenAI

response = OpenAI().complete("Paul Graham is ")
print(response)
2 comments
L
A
Andrei
·

Chat

Hello, What is best Chat Modes recommended to use with RAG query engine, when I need to refine answer base on chat history and new user questions ?

-condense_question - Look at the chat history and re-write the user message to be a query for the index. Return the response after reading the response from the query engine.
-context - Retrieve nodes from the index using every user message. The retrieved text is inserted into the system prompt, so that the chat engine can either respond naturally or use the context from the query engine.
-condense_plus_context - A combination of condense_question and context. Look at the chat history and re-write the user message to be a retrieval query for the index. The retrieved text is inserted into the system prompt, so that the chat engine can either respond naturally or use the context from the query engine.

What is better recommended to use ?
Thank you
2 comments
A
L
Hello everyone,

I'm fallowing this implementation to get subquery QA and metadata node.text citations used for each subquery.

Plain Text
# iterate through sub_question items captured in SUB_QUESTION event
from llama_index.core.callbacks import CBEventType, EventPayload

for i, (start_event, end_event) in enumerate(
    llama_debug.get_event_pairs(CBEventType.SUB_QUESTION)
):
    qa_pair = end_event.payload[EventPayload.SUB_QUESTION]
    print("Sub Question " + str(i) + ": " + qa_pair.sub_q.sub_question.strip())
    print("Answer: " + qa_pair.answer.strip())
    print("====================================")


How I can access for each subquestion source_nodes to extract node.metadata, node.text, score used ?

Thank you
5 comments
L
A
I'm currently exploring the capabilities of the SubQuestionQueryEngine and its potential, and was wondering how I can use a custom prompt to better control the decomposition of complex queries into subqueries. Could you guide me on how to define and integrate a custom prompt for this purpose? Thanks!
2 comments
W
A
I'm having about 1000 documents with technical hardware specifications, where each document have a separate index created and one document have around 100-150 pages. What will be best recommended implementation to allow me when I have a question about a specific model, to be used only the index that will have that specific information and not query on all indexes ? Thanks
5 comments
W
A
There are any plans from LlamaIndex to develop and provide support for a similar FastAPI like LangChain created https://blog.langchain.dev/introducing-langserve/ ?
6 comments
A
j
Hello, how I can configure token_counter for SimpleChatEngine? I'm using
Plain Text
token_counter = TokenCountingHandler(
        tokenizer=tiktoken.encoding_for_model("gpt-3.5-turbo").encode,
        verbose=True
    )
Settings.callback_manager = CallbackManager([token_counter])
but no results
13 comments
A
L
Hello, I have an issue when using QueryFusionRetriever, I'm using similarity_top_k=8 but in chunks I see only 3. How I can configure more chunks ? Thanks
10 comments
A
L
Hello, there is already a implementation to use in case I want to resolve a more complex task and to start first with LLM to create a step plan and then to make a separate query for each step ? I'm using Claude as LLM not OpenAI, what is recommended to use ? Thank you
2 comments
L
Hello, I have one question, If I'm using Claude 3 from AWS Bedrock, when configuring the prompt for qa_prompt, refine_prompt, chat_prompt should all need to have "\n\nHuman: <prompt> \n\nAssistant:" or only the qa_prompt ? Thanks
5 comments
L
A
1 comment
L
Hi @Logan M, if I have some documents 50-100 pages, split in chunks of 1024, and I want to send full document to llm, will be ok to send all chunks or is better to create a new index with SummaryIndex.from_documents() and use this in query engine ? What option will have better results or will be the same ? or there is a better option ? Thanks
9 comments
L
A
Hello, I'm trying to upgrade my old files from version 0.9 to 0.10 with llamaindex-cli upgrade-file myfile.py and get ImportError: cannot import name 'SimpleDirectoryReader' from 'llama_index.core' (unknown location) . Any recommendations ? Thanks
7 comments
W
A
A
Andrei
·

How can I use

How can I use CondensePlusContextChatEngine with a query_engine instead of retriever ?
2 comments
L
@Logan M @WhiteFang_Jr when I'm using chat with CondensePlusContextChatEngine, user question is changed and I can see in console logs -- Querying with: "new question". How I can extract this question in order to save and use it ?
4 comments
L
A
@Logan M can you give me some advice on how can I replace this part
Plain Text
custom_prompt = PromptTemplate(
    """\
Given a conversation (between Human and Assistant) and a follow up message from Human, \
rewrite the message to be a standalone question that captures all relevant context \
from the conversation.

<Chat History>
{chat_history}

<Follow Up Message>
{question}

<Standalone question>
"""
)
with somthing like
Plain Text
my_template = "Given a conversation (between Human and Assistant) and a follow up message from Human, rewrite the message to be a standalone question that captures all relevant context from the conversation.

<Chat History>
{chat_history}

<Follow Up Message>
{question}

<Standalone question>"

custom_prompt = PromptTemplate(my_template)
3 comments
A
W
Hello LlamaIndex Community,
I'm looking to create an Agent workflow utilizing LlamaIndex to analyze a task descriptions, suggest relevant instructions steps, and generate a structured workflow based on these descriptions. My goal is to integrate this functionality into an application that manages and automates various tasks with documents using AI.
Here are my specific requirements:
  1. Task Description Analysis: The system should interpret and analyze text-based task descriptions.
  2. Instruction Generation: Based on the analysis, the system should suggest actionable instructions or steps.
  3. Workflow Creation: The final objective is to formulate a structured workflow or task list derived from the task descriptions.
Could you please provide recommendations or best practices on:
• Which components of LlamaIndex are most suited for these requirements?
• Any specific strategies or modules within LlamaIndex that can efficiently handle these tasks?
• Examples or case studies where similar implementations were successfully achieved?
Any insights, examples, or pointers to relevant documentation would be greatly appreciated.
Thank you in advance!
12 comments
S
L
A
D
@kapa.ai How to configure external chat memory to chat engine ?
7 comments
k
A