Skip to main content

memory_tools.py

Source: sunholo/vertex/memory_tools.py

Functions

get_google_search_grounding(vector_name)

No docstring available.

get_vertex_memories(vector_name)

Retrieves a LlamaIndex corpus from Vertex AI based on the provided Google Cloud configuration.

This function constructs a corpus name using project details from the configuration and attempts to fetch the corresponding corpus. If the corpus cannot be retrieved, it raises an error.

Parameters:

  • vector_name: The name of the of VAC

Returns:

  • List of corpus objects fetched from Vertex AI.

Raises:

  • ValueError: If any of the required configurations (project_id, location, or rag_id) are missing, or if the corpus cannot be retrieved.

Example:


# Fetch the corpus
try:
corpus = get_corpus("edmonbrain")
print("Corpus fetched successfully:", corpus)
except ValueError as e:
print("Error fetching corpus:", str(e))

Prints Gemini response with grounding citations.

Sunholo Multivac

Get in touch to see if we can help with your GenAI project.

Contact us

Other Links

Sunholo Multivac - GenAIOps

Copyright ©

Holosun ApS 2024