SimplerLLM 0.3.1.10__tar.gz → 0.3.1.11__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.
Files changed (111) hide show
  1. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/PKG-INFO +1 -1
  2. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_addons.py +22 -10
  3. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM.egg-info/PKG-INFO +1 -1
  4. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM.egg-info/SOURCES.txt +0 -1
  5. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/setup.py +1 -1
  6. simplerllm-0.3.1.10/tests/test_reliable_json.py +0 -118
  7. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/LICENSE +0 -0
  8. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/__init__.py +0 -0
  9. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/__init__.py +0 -0
  10. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/agent.py +0 -0
  11. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_agent_in_team.py +0 -0
  12. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_human_in_loop_agent.py +0 -0
  13. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_planning_agent.py +0 -0
  14. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_rag_agent.py +0 -0
  15. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_react_agent.py +0 -0
  16. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_reflection_agent.py +0 -0
  17. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/core_tool_calling_agent.py +0 -0
  18. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/memory_agent.py +0 -0
  19. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/pandas_agent_exp.py +0 -0
  20. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/agents_deprecated/sql_agent_exp.py +0 -0
  21. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/image/__init__.py +0 -0
  22. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/image/img_helper_funcs.py +0 -0
  23. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/image/stability_ai.py +0 -0
  24. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/__init__.py +0 -0
  25. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/embeddings.py +0 -0
  26. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/__init__.py +0 -0
  27. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/base.py +0 -0
  28. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/reliable.py +0 -0
  29. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/__init__.py +0 -0
  30. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/anthropic_wrapper.py +0 -0
  31. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/deepseek_wrapper.py +0 -0
  32. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/gemini_wrapper.py +0 -0
  33. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/ollama_wrapper.py +0 -0
  34. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm/wrappers/openai_wrapper.py +0 -0
  35. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/__init__.py +0 -0
  36. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/anthropic_llm.py +0 -0
  37. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/deepseek_llm.py +0 -0
  38. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/gemini_llm.py +0 -0
  39. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/llm_response_models.py +0 -0
  40. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/ollama_llm.py +0 -0
  41. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/openai_llm.py +0 -0
  42. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_providers/transformers_llm.py +0 -0
  43. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_router/__init__.py +0 -0
  44. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_router/models.py +0 -0
  45. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/language/llm_router/router.py +0 -0
  46. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/prompts/__init__.py +0 -0
  47. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/prompts/messages_template.py +0 -0
  48. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/prompts/prompt_builder.py +0 -0
  49. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/__init__.py +0 -0
  50. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/file_functions.py +0 -0
  51. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/file_loader.py +0 -0
  52. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/generic_loader.py +0 -0
  53. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/json_helpers.py +0 -0
  54. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/pandas_func.py +0 -0
  55. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/predefined_tools.py +0 -0
  56. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/python_func.py +0 -0
  57. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/rapid_api.py +0 -0
  58. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/serp.py +0 -0
  59. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/text_chunker.py +0 -0
  60. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/web_crawler.py +0 -0
  61. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/tools/youtube.py +0 -0
  62. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/utils/__init__.py +0 -0
  63. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/utils/custom_verbose.py +0 -0
  64. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/vectors/__init__.py +0 -0
  65. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/vectors/vector_storage.py +0 -0
  66. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/workflow/__init__.py +0 -0
  67. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/workflow/builder.py +0 -0
  68. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM/workflow/test_helpers.py +0 -0
  69. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM.egg-info/dependency_links.txt +0 -0
  70. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM.egg-info/requires.txt +0 -0
  71. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/SimplerLLM.egg-info/top_level.txt +0 -0
  72. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/setup.cfg +0 -0
  73. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/NewWorkFlowTest.py +0 -0
  74. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/WorkflowBuidler1.py +0 -0
  75. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/__init__.py +0 -0
  76. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/generate_text.py +0 -0
  77. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/lib_test.py +0 -0
  78. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/local_llm.py +0 -0
  79. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/serp_results.py +0 -0
  80. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_chat_with_text_linked.py +0 -0
  81. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_chat_youtube.py +0 -0
  82. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_chat_youtube_no_embed.py +0 -0
  83. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_chunker.py +0 -0
  84. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_complex_json.py +0 -0
  85. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_data_agent.py +0 -0
  86. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_embed.py +0 -0
  87. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_generate.py +0 -0
  88. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_helpers.py +0 -0
  89. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_llm_router.py +0 -0
  90. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_lwh.py +0 -0
  91. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_ollama.py +0 -0
  92. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_pydantic.py +0 -0
  93. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_reAct_agent.py +0 -0
  94. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_react_core_agent.py +0 -0
  95. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_reflection_core_agent.py +0 -0
  96. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_reliable.py +0 -0
  97. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_search_query.py +0 -0
  98. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_sql_agent.py +0 -0
  99. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_token_count.py +0 -0
  100. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_tool.py +0 -0
  101. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_tool_agent.py +0 -0
  102. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_vector_chat.py +0 -0
  103. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_youtube_chat_adv.py +0 -0
  104. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/test_youtube_tool.py +0 -0
  105. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/tweet_generator.py +0 -0
  106. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/vb_ui.py +0 -0
  107. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/vd_full_test.py +0 -0
  108. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/vd_test.py +0 -0
  109. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/workflow.py +0 -0
  110. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/workflow_import_test.py +0 -0
  111. {simplerllm-0.3.1.10 → simplerllm-0.3.1.11}/tests/workflow_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SimplerLLM
3
- Version: 0.3.1.10
3
+ Version: 0.3.1.11
4
4
  Summary: An easy-to-use Library for interacting with language models.
5
5
  Home-page: https://github.com/hassancs91/SimplerLLM
6
6
  Author: Hasan Aboul Hasan
@@ -124,7 +124,7 @@ def generate_pydantic_json_model_reliable(
124
124
  custom_prompt_suffix: str = None,
125
125
  system_prompt: str = "The Output is a VALID Structured JSON",
126
126
  full_response: bool = False,
127
- ) -> Union[Tuple[BaseModel, LLMProvider], Tuple[BaseModel, LLMFullResponse, LLMProvider]]:
127
+ ) -> Union[Tuple[BaseModel, LLMProvider, str], Tuple[BaseModel, LLMFullResponse, LLMProvider, str]]:
128
128
  """
129
129
  Generates a model instance using ReliableLLM with fallback capability.
130
130
 
@@ -132,10 +132,16 @@ def generate_pydantic_json_model_reliable(
132
132
  :param prompt: The fully formatted prompt including the topic.
133
133
  :param reliable_llm: Instance of ReliableLLM with primary and secondary providers.
134
134
  :param max_retries: Maximum number of retries on validation errors.
135
+ :param max_tokens: Maximum number of tokens to generate.
135
136
  :param initial_delay: Initial delay in seconds before the first retry.
136
137
  :param custom_prompt_suffix: Optional string to customize or override the generated prompt extension.
138
+ :param system_prompt: System prompt to set the context for the LLM.
139
+ :param full_response: If True, returns the full API response.
137
140
 
138
- :return: BaseModel object if successful, otherwise error message.
141
+ :return:
142
+ - If full_response=False: Tuple of (model_object, provider, model_name)
143
+ - If full_response=True: Tuple of (model_object, full_response, provider, model_name)
144
+ - Error message string if unsuccessful
139
145
  """
140
146
  optimized_prompt = create_optimized_prompt(prompt, model_class, custom_prompt_suffix)
141
147
  backoff_delays = [initial_delay * (2**attempt) for attempt in range(max_retries + 1)]
@@ -152,10 +158,10 @@ def generate_pydantic_json_model_reliable(
152
158
  )
153
159
 
154
160
  if full_response:
155
- ai_response, provider = result
161
+ ai_response, provider, model_name = result
156
162
  response_text = ai_response.generated_text
157
163
  else:
158
- response_text, provider = result
164
+ response_text, provider, model_name = result
159
165
 
160
166
  if response_text:
161
167
  json_object = extract_json_from_text(response_text)
@@ -168,7 +174,7 @@ def generate_pydantic_json_model_reliable(
168
174
  model_object = convert_json_to_pydantic_model(
169
175
  model_class, json_object[0]
170
176
  )
171
- return (model_object, ai_response, provider) if full_response else (model_object, provider)
177
+ return (model_object, ai_response, provider, model_name) if full_response else (model_object, provider, model_name)
172
178
 
173
179
  except Exception as e:
174
180
  return f"Exception occurred: {e}"
@@ -190,7 +196,7 @@ async def generate_pydantic_json_model_reliable_async(
190
196
  custom_prompt_suffix: str = None,
191
197
  system_prompt: str = "The Output is a VALID Structured JSON",
192
198
  full_response: bool = False,
193
- ) -> Union[Tuple[BaseModel, LLMProvider], Tuple[BaseModel, LLMFullResponse, LLMProvider]]:
199
+ ) -> Union[Tuple[BaseModel, LLMProvider, str], Tuple[BaseModel, LLMFullResponse, LLMProvider, str]]:
194
200
  """
195
201
  Asynchronously generates a model instance using ReliableLLM with fallback capability.
196
202
 
@@ -198,10 +204,16 @@ async def generate_pydantic_json_model_reliable_async(
198
204
  :param prompt: The fully formatted prompt including the topic.
199
205
  :param reliable_llm: Instance of ReliableLLM with primary and secondary providers.
200
206
  :param max_retries: Maximum number of retries on validation errors.
207
+ :param max_tokens: Maximum number of tokens to generate.
201
208
  :param initial_delay: Initial delay in seconds before the first retry.
202
209
  :param custom_prompt_suffix: Optional string to customize or override the generated prompt extension.
210
+ :param system_prompt: System prompt to set the context for the LLM.
211
+ :param full_response: If True, returns the full API response.
203
212
 
204
- :return: BaseModel object if successful, otherwise error message.
213
+ :return:
214
+ - If full_response=False: Tuple of (model_object, provider, model_name)
215
+ - If full_response=True: Tuple of (model_object, full_response, provider, model_name)
216
+ - Error message string if unsuccessful
205
217
  """
206
218
  optimized_prompt = create_optimized_prompt(prompt, model_class, custom_prompt_suffix)
207
219
  backoff_delays = [initial_delay * (2**attempt) for attempt in range(max_retries + 1)]
@@ -218,10 +230,10 @@ async def generate_pydantic_json_model_reliable_async(
218
230
  )
219
231
 
220
232
  if full_response:
221
- ai_response, provider = result
233
+ ai_response, provider, model_name = result
222
234
  response_text = ai_response.generated_text
223
235
  else:
224
- response_text, provider = result
236
+ response_text, provider, model_name = result
225
237
 
226
238
  if response_text:
227
239
  json_object = extract_json_from_text(response_text)
@@ -234,7 +246,7 @@ async def generate_pydantic_json_model_reliable_async(
234
246
  model_object = convert_json_to_pydantic_model(
235
247
  model_class, json_object[0]
236
248
  )
237
- return (model_object, ai_response, provider) if full_response else (model_object, provider)
249
+ return (model_object, ai_response, provider, model_name) if full_response else (model_object, provider, model_name)
238
250
 
239
251
  except Exception as e:
240
252
  return f"Exception occurred: {e}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SimplerLLM
3
- Version: 0.3.1.10
3
+ Version: 0.3.1.11
4
4
  Summary: An easy-to-use Library for interacting with language models.
5
5
  Home-page: https://github.com/hassancs91/SimplerLLM
6
6
  Author: Hasan Aboul Hasan
@@ -91,7 +91,6 @@ tests/test_reAct_agent.py
91
91
  tests/test_react_core_agent.py
92
92
  tests/test_reflection_core_agent.py
93
93
  tests/test_reliable.py
94
- tests/test_reliable_json.py
95
94
  tests/test_search_query.py
96
95
  tests/test_sql_agent.py
97
96
  tests/test_token_count.py
@@ -11,7 +11,7 @@ with open("README.md", encoding="utf-8") as f:
11
11
 
12
12
  setup(
13
13
  name="SimplerLLM",
14
- version="0.3.1.10",
14
+ version="0.3.1.11",
15
15
  author="Hasan Aboul Hasan",
16
16
  author_email="hasan@learnwithhasan.com",
17
17
  description="An easy-to-use Library for interacting with language models.",
@@ -1,118 +0,0 @@
1
- from typing import List
2
- from pydantic import BaseModel
3
- from SimplerLLM.language.llm import LLM, LLMProvider
4
- from SimplerLLM.language.llm.reliable import ReliableLLM
5
- from SimplerLLM.language.llm_addons import generate_pydantic_json_model_reliable
6
-
7
- # Using the same model from test_complex_json.py for consistency
8
- class EffectivenessScore(BaseModel):
9
- Score: int
10
- Explanation: str
11
-
12
- class ScannabilityScore(BaseModel):
13
- Score: int
14
- Explanation: str
15
-
16
- class SentimentAnalysis(BaseModel):
17
- Tone: str
18
- Explanation: str
19
-
20
- class LengthAnalysis(BaseModel):
21
- number_of_chars: str
22
- Explanation: str
23
-
24
- class SpamTriggers(BaseModel):
25
- Triggers: List[str]
26
- Explanation: str
27
-
28
- class AllCapsWords(BaseModel):
29
- Words: List[str]
30
- Impact: str
31
-
32
- class Emojis(BaseModel):
33
- Recommendation: str
34
- Explanation: str
35
-
36
- class EmailSubjectLineAnalysis(BaseModel):
37
- Effectiveness_Score: EffectivenessScore
38
- Scannability_Score: ScannabilityScore
39
- Sentiment_Analysis: SentimentAnalysis
40
- Length_Analysis: LengthAnalysis
41
- Spam_Triggers: SpamTriggers
42
- All_Caps_Words: AllCapsWords
43
- Emojis: Emojis
44
- Suggested_Preview_Text: List[str]
45
- Alternative_Subject_Lines: List[str]
46
-
47
- # Create primary and secondary LLM instances
48
- primary_llm = LLM.create(
49
- provider=LLMProvider.ANTHROPIC,
50
- model_name="claude-3-opus-latest",
51
- verbose=True
52
- )
53
-
54
- secondary_llm = LLM.create(
55
- provider=LLMProvider.OPENAI,
56
- model_name="gpt-4o",
57
- )
58
-
59
- # Create ReliableLLM instance
60
- reliable_llm = ReliableLLM(primary_llm=primary_llm, secondary_llm=secondary_llm, verbose=True)
61
-
62
- # Test prompt
63
- subject_line_grader_prompt = """
64
- You are a professional email subject line copywriter tasked with analyzing and providing feedback on a given subject line. Your analysis should be thorough, considering multiple factors to ensure the best possible subject line optimization.
65
-
66
- Here is the information you need to analyze:
67
-
68
- <subject_line>
69
- {subject_line}
70
- </subject_line>
71
-
72
- <email_type>
73
- {email_type}
74
- </email_type>
75
-
76
- <is_time_sensitive>
77
- {is_time_sensitive}
78
- </is_time_sensitive>
79
-
80
- <is_followup>
81
- {is_followup}
82
- </is_followup>
83
-
84
- <is_series>
85
- {is_series}
86
- </is_series>
87
-
88
- Please analyze the subject line considering the following aspects:
89
- 1. Effectiveness
90
- 2. Scannability
91
- 3. Sentiment
92
- 4. Length
93
- 5. Spam Triggers
94
- 6. All Caps Words
95
- 7. Emoji Usage
96
- """
97
-
98
- # Format the prompt with test data
99
- generated_prompt = subject_line_grader_prompt.format(
100
- subject_line="3 seo tips",
101
- email_type="Newsletter",
102
- is_time_sensitive="No",
103
- is_followup="No",
104
- is_series="No"
105
- )
106
-
107
- # Generate model using ReliableLLM
108
- model_response, used_provider = generate_pydantic_json_model_reliable(
109
- model_class=EmailSubjectLineAnalysis,
110
- prompt=generated_prompt,
111
- reliable_llm=reliable_llm,
112
- max_retries=2,
113
- max_tokens=4096,
114
- system_prompt="Generate in English Language"
115
- )
116
-
117
- print("Response from ReliableLLM using provider:", used_provider)
118
- print(model_response)
File without changes
File without changes