added knowledge to agent level (#1655)

* added knowledge to agent level

* linted

* added doc

* added from suggestions

* added test

* fixes from discussion

* fix docs

* fix test

* rm cassette for knowledge_sources test as its a mock and update agent doc string

* fix test

* rm unused

* linted
This commit is contained in:
Lorenze Jay
2024-11-27 11:33:07 -08:00
committed by GitHub
parent 366bbbbea3
commit c6a6c918e0
10 changed files with 654 additions and 91 deletions

View File

@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional
from pydantic import Field
@@ -9,6 +9,7 @@ class StringKnowledgeSource(BaseKnowledgeSource):
"""A knowledge source that stores and queries plain text content using embeddings."""
content: str = Field(...)
collection_name: Optional[str] = Field(default=None)
def model_post_init(self, _):
"""Post-initialization method to validate content."""