tasks-prompts-chain 0.0.4__tar.gz → 0.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tasks_prompts_chain
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: A Python library for creating and executing chains of prompts using OpenAI's SDK with streaming support and template formatting.
5
5
  Project-URL: Homepage, https://github.com/smirfolio/tasks_prompts_chain
6
6
  Project-URL: Issues, https://github.com/smirfolio/tasks_prompts_chain/issues
@@ -59,8 +59,13 @@ from tasks_prompts_chain import TasksPromptsChain
59
59
  async def main():
60
60
  # Initialize the chain
61
61
  chain = TasksPromptsChain(
62
- model="gpt-3.5-turbo",
63
- api_key="your-api-key",
62
+ model_options={
63
+ "model": "gpt-3.5-turbo",
64
+ "api_key": "your-api-key",
65
+ "temperature": 0.1,
66
+ "max_tokens": 4120,
67
+ "stream": True
68
+ },
64
69
  final_result_placeholder="design_result"
65
70
  )
66
71
 
@@ -93,8 +98,13 @@ async def main():
93
98
 
94
99
  ```python
95
100
  chain = TasksPromptsChain(
96
- model="gpt-3.5-turbo",
97
- api_key="your-api-key",
101
+ model_options={
102
+ "model": "gpt-3.5-turbo",
103
+ "api_key": "your-api-key",
104
+ "temperature": 0.1,
105
+ "max_tokens": 4120,
106
+ "stream": True
107
+ },
98
108
  final_result_placeholder="result",
99
109
  system_prompt="You are a professional design expert specialized in luxury products",
100
110
  system_apply_to_all_prompts=True
@@ -105,10 +115,15 @@ chain = TasksPromptsChain(
105
115
 
106
116
  ```python
107
117
  chain = TasksPromptsChain(
108
- model="gpt-3.5-turbo",
109
- api_key="your-api-key",
118
+ model_options={
119
+ "model": "your-custom-model",
120
+ "api_key": "your-api-key",
121
+ "base_url": "https://your-custom-endpoint.com/v1",
122
+ "temperature": 0.1,
123
+ "max_tokens": 4120,
124
+ "stream": True
125
+ },
110
126
  final_result_placeholder="result",
111
- base_url="https://your-custom-endpoint.com/v1"
112
127
  )
113
128
  ```
114
129
 
@@ -45,8 +45,13 @@ from tasks_prompts_chain import TasksPromptsChain
45
45
  async def main():
46
46
  # Initialize the chain
47
47
  chain = TasksPromptsChain(
48
- model="gpt-3.5-turbo",
49
- api_key="your-api-key",
48
+ model_options={
49
+ "model": "gpt-3.5-turbo",
50
+ "api_key": "your-api-key",
51
+ "temperature": 0.1,
52
+ "max_tokens": 4120,
53
+ "stream": True
54
+ },
50
55
  final_result_placeholder="design_result"
51
56
  )
52
57
 
@@ -79,8 +84,13 @@ async def main():
79
84
 
80
85
  ```python
81
86
  chain = TasksPromptsChain(
82
- model="gpt-3.5-turbo",
83
- api_key="your-api-key",
87
+ model_options={
88
+ "model": "gpt-3.5-turbo",
89
+ "api_key": "your-api-key",
90
+ "temperature": 0.1,
91
+ "max_tokens": 4120,
92
+ "stream": True
93
+ },
84
94
  final_result_placeholder="result",
85
95
  system_prompt="You are a professional design expert specialized in luxury products",
86
96
  system_apply_to_all_prompts=True
@@ -91,10 +101,15 @@ chain = TasksPromptsChain(
91
101
 
92
102
  ```python
93
103
  chain = TasksPromptsChain(
94
- model="gpt-3.5-turbo",
95
- api_key="your-api-key",
104
+ model_options={
105
+ "model": "your-custom-model",
106
+ "api_key": "your-api-key",
107
+ "base_url": "https://your-custom-endpoint.com/v1",
108
+ "temperature": 0.1,
109
+ "max_tokens": 4120,
110
+ "stream": True
111
+ },
96
112
  final_result_placeholder="result",
97
- base_url="https://your-custom-endpoint.com/v1"
98
113
  )
99
114
  ```
100
115
 
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "tasks_prompts_chain"
6
- version = "0.0.4"
6
+ version = "0.0.5"
7
7
  authors = [
8
8
  { name="Samir Ben Sghaier", email="ben.sghaier.samir@gmail.com" },
9
9
  ]
@@ -187,7 +187,7 @@ class TasksPromptsChain:
187
187
  if prompt_template.output_placeholder:
188
188
  placeholder_values[prompt_template.output_placeholder] = response_content
189
189
  self._results[prompt_template.output_placeholder] = response_content
190
- yield response_content
190
+ yield delta
191
191
 
192
192
  except Exception as e:
193
193
  raise Exception(f"Error in prompt chain execution at prompt {i}: {str(e)}")