Find answers from the community

v
vedtam
Offline, last seen 3 months ago
Joined September 25, 2024
v
vedtam
·

Metadata

hi guys, I'm trying to pass a list of entities as metadata along my inserted documents, but I'm getting back an error: Value for metadata entities must be one of (str, int, float, None)
21 comments
v
L
When converting a function into a tool via FunctionTool() is there a way include any extra prompt along the tool? My tool returns a list of links like: ['<a href="localhost/article/98">The US is proposing ...</a>'], problem is, when the response is synthetised, the LLM removes the markup and returns: [The US is proposing ...](localhost/article/98)
12 comments
v
L
Hi guys. I'm trying to understand why the message printed to the console (verbose output: .from_tools(verbose=True) ...) is different than the final message I'm getting back in Postman when testing?

I have disabled templates, post processors and response synthesizer:
Plain Text
retriever = VectorIndexRetriever(
    index=index,
    similarity_top_k=3
  )
  node_postprocessors = [
        SimilarityPostprocessor(similarity_cutoff=0.5),
        MetadataReplacementPostProcessor(target_metadata_key="window"),
        # KeywordNodePostprocessor(
        # required_keywords=["news"],
        # exclude_keywords=["playground"])
    ]
  response_synthesizer = get_response_synthesizer(
    response_mode="compact",
    # text_qa_template=text_qa_template,
    # refine_template=refine_template
  )
  vector_db_query_engine = RetrieverQueryEngine(
    retriever=retriever,
    # node_postprocessors=node_postprocessors,
    # response_synthesizer=response_synthesizer
  )
  vector_query_engine_tool = QueryEngineTool(
    query_engine=vector_db_query_engine,
    metadata=ToolMetadata(
      # FIXME: Inconsistent naming, should be `article_database` instead
      name="news_database",
      description="Get news articles and information about political entities and events. Use a detailed plain text question as input to the tool.",
    )
  )
  return OpenAIAgent.from_tools(
    [latest_articles_tool, vector_query_engine_tool],
    llm=OpenAI(model="gpt-3.5-turbo-1106"),
    verbose=True,
    # system_prompt=system_prompt,
    temperature=0,
    seed=1234
  )
3 comments
v
r
L
I'm also wondering, when setting the id_ field for my documents (per the docs):
Plain Text
documents.append(Document(
        id_=str(s['id']),
        text=s['bodytext'],
        metadata={
          'id': s['id'],
          'headline': s['headline'],
          'published_time': s['date'],
...

Why in pinecone the id_ is still a random UID (screenshot attached).
5 comments
v
L
does this mean that we are responsible for updating documents stored in Pincecon?
6 comments
L
v
v
vedtam
·

Chat

Hmm, setting the "chat_mode" explicitely to "condense_question" seems to fix the issue as this is supposed to allways query the query engine. Interestingly, leaving it unspecified, it fails to return the published date. Isn't "condensed_question" supposed to be the default mode?
2 comments
v
L