Skip to content

Commit 7612a14

Browse files
Merge pull request #12 from zhanglei1172/master
Add feature(custom text embedding in plugin)
2 parents 68dac2b + fa95b5d commit 7612a14

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/auto_gpt_plugin_template/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,30 @@ def handle_chat_completion(
244244
"""
245245
pass
246246

247+
@abc.abstractmethod
248+
def can_handle_text_embedding(
249+
self, text: str
250+
) -> bool:
251+
"""This method is called to check that the plugin can
252+
handle the text_embedding method.
253+
Args:
254+
text (str): The text to be convert to embedding.
255+
Returns:
256+
bool: True if the plugin can handle the text_embedding method."""
257+
return False
258+
259+
@abc.abstractmethod
260+
def handle_text_embedding(
261+
self, text: str
262+
) -> list:
263+
"""This method is called when the chat completion is done.
264+
Args:
265+
text (str): The text to be convert to embedding.
266+
Returns:
267+
list: The text embedding.
268+
"""
269+
pass
270+
247271
@abc.abstractmethod
248272
def can_handle_user_input(self, user_input: str) -> bool:
249273
"""This method is called to check that the plugin can

0 commit comments

Comments
 (0)