ASUllmAPI 2.0.6__tar.gz → 2.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,20 +6,26 @@ __author__ = ['swliu', 'vshourie']
6
6
 
7
7
  class ModelConfig:
8
8
 
9
- def __init__(self, access_token: str = None, action: str = None, api_url: str = "", enable_history: bool = False,
10
- enable_search: bool = True, history: List[Dict[str, str]] = None, model_max_tokens: int = None,
11
- model_temperature: float = None, model_top_k: int = None, model_top_p: int = None, name: str = "",
12
- project_id: str = None, provider: str = "", response_format_type: str = "",
13
- search_collection: str = "asu", search_db_type: str = "opensearch",
14
- search_output_fields: List[str] = None, search_retrieval_type: str = "chunk",
15
- search_source_name: List[str] = None, search_tags: list = None, search_top_k: int = 3,
16
- search_prompt_mode: str = "unrestricted", search_prompt: str = None, semantic_caching: bool = False,
17
- session_id: str = None, system_prompt: str = None):
9
+ def __init__(self, access_token: str = None, action: str = None, api_url: str = "",
10
+ enhance_prompt_timezone: str = None, enhance_prompt_time: bool = None,
11
+ enhance_prompt_date: bool = None, enhance_prompt_verbosity: str = None,
12
+ enable_history: bool = False, enable_search: bool = True, history: List[Dict[str, str]] = None,
13
+ model_max_tokens: int = None, model_temperature: float = None, model_top_k: int = None,
14
+ model_top_p: int = None, name: str = "", project_id: str = None, provider: str = "",
15
+ response_format_type: str = "", search_collection: str = "asu", search_db_type: str = "opensearch",
16
+ search_expr: str = None, search_output_fields: List[str] = None, search_reranker: bool = False,
17
+ search_retrieval_type: str = "chunk", search_source_name: List[str] = None, search_tags: list = None,
18
+ search_top_k: int = 3, search_prompt_mode: str = "unrestricted", search_prompt: str = None,
19
+ semantic_caching: bool = False, session_id: str = None, system_prompt: str = None):
18
20
  self.access_token = access_token
19
21
  self.action = action
20
22
  self.api_url = api_url
21
23
  self.enable_history = enable_history
22
24
  self.enable_search = enable_search
25
+ self.enhance_prompt_timezone = enhance_prompt_timezone
26
+ self.enhance_prompt_time = enhance_prompt_time
27
+ self.enhance_prompt_date = enhance_prompt_date
28
+ self.enhance_prompt_verbosity = enhance_prompt_verbosity
23
29
  self.history = history
24
30
  self.model_max_tokens = model_max_tokens
25
31
  self.model_temperature = model_temperature
@@ -31,13 +37,15 @@ class ModelConfig:
31
37
  self.response_format_type = response_format_type
32
38
  self.search_collection = search_collection
33
39
  self.search_db_type = search_db_type
40
+ self.search_expr = search_expr
34
41
  self.search_output_fields = search_output_fields
42
+ self.search_prompt = search_prompt
43
+ self.search_prompt_mode = search_prompt_mode
44
+ self.search_reranker = search_reranker
45
+ self.search_retrieval_type = search_retrieval_type
35
46
  self.search_source_name = search_source_name
36
47
  self.search_tags = search_tags
37
48
  self.search_top_k = search_top_k
38
- self.search_retrieval_type = search_retrieval_type
39
- self.search_prompt_mode = search_prompt_mode
40
- self.search_prompt = search_prompt
41
49
  self.semantic_caching = semantic_caching
42
50
  self.session_id = session_id
43
51
  self.system_prompt = system_prompt
@@ -79,6 +87,8 @@ class ModelConfig:
79
87
  payload["model_provider"] = self.provider
80
88
  if self.project_id:
81
89
  payload["project_id"] = self.project_id
90
+ if self.prompt_enhancers:
91
+ payload["enhance_prompt"] = self.prompt_enhancers
82
92
  if self.response_format:
83
93
  payload["response_format"] = self.response_format
84
94
  if self.search_params:
@@ -105,6 +115,22 @@ class ModelConfig:
105
115
  model_params["system_prompt"] = self.system_prompt
106
116
  return model_params
107
117
 
118
+ @property
119
+ def prompt_enhancers(self):
120
+ self.__validate_access()
121
+
122
+ prompt_enhancer_params = {}
123
+ if self.enhance_prompt_date is not None:
124
+ prompt_enhancer_params["date"] = self.enhance_prompt_date
125
+ if self.enhance_prompt_time is not None:
126
+ prompt_enhancer_params["time"] = self.enhance_prompt_time
127
+ if self.enhance_prompt_timezone is not None:
128
+ prompt_enhancer_params["timezone"] = self.enhance_prompt_timezone
129
+ if self.enhance_prompt_verbosity is not None:
130
+ prompt_enhancer_params["verbosity"] = self.enhance_prompt_verbosity
131
+
132
+ return prompt_enhancer_params
133
+
108
134
  @property
109
135
  def search_params(self):
110
136
  self.__validate_access()
@@ -118,10 +144,14 @@ class ModelConfig:
118
144
 
119
145
  if self.search_prompt_mode is not None:
120
146
  search_params["prompt_mode"] = self.search_prompt_mode
147
+ if self.search_expr is not None:
148
+ search_params["expr"] = self.search_expr
121
149
  if self.search_prompt is not None:
122
150
  search_params["search_prompt"] = self.search_prompt
123
151
  if self.search_source_name is not None:
124
152
  search_params["source_name"] = self.search_source_name
153
+ if self.search_reranker is not None:
154
+ search_params["reranker"] = self.search_reranker
125
155
  if self.search_tags is not None:
126
156
  search_params["tags"] = self.search_tags
127
157
  if self.search_output_fields is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ASUllmAPI
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: A simple python package to facilitate connection to ASU LLM API
5
5
  Author-email: Stella Wenxing Liu <stellawenxingliu@gmail.com>, Varun Shourie <svarun195@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ASUllmAPI
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: A simple python package to facilitate connection to ASU LLM API
5
5
  Author-email: Stella Wenxing Liu <stellawenxingliu@gmail.com>, Varun Shourie <svarun195@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ASUllmAPI"
3
- version = "2.0.6"
3
+ version = "2.0.7"
4
4
  authors = [
5
5
  { name="Stella Wenxing Liu", email="stellawenxingliu@gmail.com" },
6
6
  { name="Varun Shourie", email="svarun195@gmail.com" }
File without changes
File without changes
File without changes
File without changes
File without changes