-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathprompt_client.py
More file actions
46 lines (33 loc) · 1.31 KB
/
prompt_client.py
File metadata and controls
46 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from __future__ import absolute_import, annotations
import re # noqa: F401
from abc import ABC, abstractmethod
from typing import List, Optional
# python 2 and python 3 compatibility library
from conductor.client.http.models.prompt_template import PromptTemplate
from conductor.client.orkes.models.metadata_tag import MetadataTag
class PromptClient(ABC):
@abstractmethod
def save_prompt(self, prompt_name: str, description: str, prompt_template: str):
pass
@abstractmethod
def get_prompt(self, prompt_name: str) -> PromptTemplate:
pass
@abstractmethod
def get_prompts(self):
pass
@abstractmethod
def delete_prompt(self, prompt_name: str):
pass
@abstractmethod
def get_tags_for_prompt_template(self, prompt_name: str) -> List[MetadataTag]:
pass
@abstractmethod
def update_tag_for_prompt_template(self, prompt_name: str, tags: List[MetadataTag]):
pass
@abstractmethod
def delete_tag_for_prompt_template(self, prompt_name: str, tags: List[MetadataTag]):
pass
@abstractmethod
def test_prompt(self, prompt_text: str, variables: dict, ai_integration: str, text_complete_model: str,
temperature : float = 0.1, top_p : float = 0.9, stop_words: Optional[List[str]] = None) -> str:
pass