Find answers from the community

Home
Members
Rouzbeh
R
Rouzbeh
Offline, last seen 3 months ago
Joined September 25, 2024
what does yes or no mean in the answer to "Do I need to use a tool"
Plain Text
> Entering new AgentExecutor chain...
Thought: Do I need to use a tool? No
11 comments
R
L
k
if I have an index like
Plain Text
cur_index = VectorStoreIndex.from_documents(
                report,
                service_context=service_context,
                storage_context=storage_context,
            )

how can I add another document to this index?
2 comments
k
I would like to run a query by my index, however, before running the query I do not know whether the index has information about this query as a result I would like to fetch data from a database, add that data to the index and then run the query. Here is how it might look like:
Plain Text
query = 'xyz'
if index capable of answering the query:
    #run the query on index
else:
    #fetch data
    #add the data to the index
    #run the query by index

Has anyone done something like this?
9 comments
L
R
k
What's the purpose refresh_cache in the below code snippet? If I set it to true, it throws error
Plain Text
UnstructuredReader = download_loader("UnstructuredReader", refresh_cache=True)
        loader = UnstructuredReader()
        document = loader.load_data(file=Path(html_file), split_documents=False)
        # read the txt file approach
        index = GPTVectorStoreIndex.from_documents(
            document, service_context=service_context
        )
        index.storage_context.persist()
4 comments
L
R
k
@kapa.ai I see the warning
"""
Token indices sequence length is longer than the specified maximum sequence length for this model (1770 > 1024). Running this sequence through the model will result in indexing errors
"""
What is the fix?
4 comments
R
L
k
The searchbot has substantially improved on https://gpt-index.readthedocs.io/ in the past two weeks or so. Did you change something?
6 comments
R
L
@kapa.ai Howdy. Let's say I've tested my index locally and it works. Not it's time to move to production and host it somewhere, what do people typically do? Any pointers to documentation or blogposts would be very much appreciated.
6 comments
L
k
R
@kapa.ai going over the example in the documentation for How to Build a Chatbot. If the index cannot find the answer in the database(all the 10K), will it resort to the actual chatgpt api and find the response?
https://gpt-index.readthedocs.io/en/latest/guides/tutorials/building_a_chatbot.html#
11 comments
R
L
k
@kapa.ai when I add a document to the index, does that mean that querying it is going to be more expensive as I add more docs to it?
Plain Text
index.insert(document)
9 comments
R
L
k
R
Rouzbeh
·

Hello

Hello,
@kapa.ai I am using gpt-4 as the model in the below setup.
Plain Text
llm_predictor = LLMPredictor(
        llm=ChatOpenAI(model_name="gpt-4", max_tokens=512, temperature=0.1))
service_context = ServiceContext.from_defaults(
        llm_predictor=llm_predictor, chunk_size_limit=512
    )
UnstructuredReader = download_loader("UnstructuredReader", refresh_cache=True)
loader = UnstructuredReader()
document = loader.load_data(file=Path(path), split_documents=False)
index = GPTVectorStoreIndex.from_documents(document, service_context=service_context)
index.storage_context.persist()

It works fine.
However, when I check my open ai profile, it is using the text-davinci api and Not gpt-4. Any idea?
8 comments
R
L