MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / query_table

Method query_table

autoagent/memory/tool_memory.py:55–71  ·  view source on GitHub ↗

Query the table and return the results

(
        self, 
        query_text: str, 
        collection: str = None, 
        n_results: int = 5
    )

Source from the content-addressed store, hash-verified

53 print(f"Batch {i+1}/{num_batches} added")
54
55 def query_table(
56 self,
57 query_text: str,
58 collection: str = None,
59 n_results: int = 5
60 ) -> pd.DataFrame:
61 """
62 Query the table and return the results
63 """
64 if not collection:
65 collection = self.collection_name
66 results = self.query([query_text], collection=collection, n_results=n_results)
67
68 metadata_results = results['metadatas'][0]
69
70 df_results = pd.DataFrame([json.loads(item['response']) for item in metadata_results])
71 return df_results
72
73 def peek_table(self, collection: str = None, n_results: int = 20) -> pd.DataFrame:
74 """

Callers 1

get_api_plugin_tools_docFunction · 0.95

Calls 1

queryMethod · 0.80

Tested by

no test coverage detected