Skip to content

Commit

Permalink
Merge pull request #12 from zhanglei1172/master
Browse files Browse the repository at this point in the history
Add feature(custom text embedding in plugin)
  • Loading branch information
BillSchumacher authored Apr 25, 2023
2 parents 68dac2b + fa95b5d commit 7612a14
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/auto_gpt_plugin_template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,30 @@ def handle_chat_completion(
"""
pass

@abc.abstractmethod
def can_handle_text_embedding(
self, text: str
) -> bool:
"""This method is called to check that the plugin can
handle the text_embedding method.
Args:
text (str): The text to be convert to embedding.
Returns:
bool: True if the plugin can handle the text_embedding method."""
return False

@abc.abstractmethod
def handle_text_embedding(
self, text: str
) -> list:
"""This method is called when the chat completion is done.
Args:
text (str): The text to be convert to embedding.
Returns:
list: The text embedding.
"""
pass

@abc.abstractmethod
def can_handle_user_input(self, user_input: str) -> bool:
"""This method is called to check that the plugin can
Expand Down

0 comments on commit 7612a14

Please sign in to comment.