Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A feature of filters is missing from assistant #1093

Open
JavanTang opened this issue Aug 13, 2024 · 0 comments
Open

A feature of filters is missing from assistant #1093

JavanTang opened this issue Aug 13, 2024 · 0 comments

Comments

@JavanTang
Copy link

What I'm looking at in vectordb, it actually has some databases that support this filters feature:phi/vectordb/pgvector/pgvector2.py

But in fact, there is no relevant implementation in the assistant, such as the following code:

    def get_references_from_knowledge_base(self, query: str, num_documents: Optional[int] = None) -> Optional[str]:
        """Return a list of references from the knowledge base"""

        if self.references_function is not None:
            reference_kwargs = {"assistant": self, "query": query, "num_documents": num_documents}
            return remove_indent(self.references_function(**reference_kwargs))

        if self.knowledge_base is None:
            return None

        relevant_docs: List[Document] = self.knowledge_base.search(query=query, num_documents=num_documents)
        if len(relevant_docs) == 0:
            return None

        if self.references_format == "yaml":
            import yaml

            return yaml.dump([doc.to_dict() for doc in relevant_docs])

        return json.dumps([doc.to_dict() for doc in relevant_docs], indent=2)

I think a feature for this could be added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant