lionagi 0.5.2__py3-none-any.whl → 0.5.4__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,235 +2,82 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
- from pydantic import JsonValue
6
-
7
5
  function_field_description = (
8
- "Specify the name of the function to execute. **Choose "
9
- "from the provided `tool_schemas`; do not invent function names.**"
10
- "Only provide function names if tool_schemas are provided. Otherwise, "
11
- "must leave blank or set to None."
6
+ "Name of the function to call from the provided `tool_schemas`. "
7
+ "If no `tool_schemas` exist, set to None or leave blank. "
8
+ "Never invent new function names outside what's given."
12
9
  )
13
10
 
14
11
  arguments_field_description = (
15
- "Provide the arguments to pass to the function as a "
16
- "dictionary. **Use argument names and types as specified in the "
17
- "`tool_schemas`; do not invent argument names.**"
12
+ "Dictionary of arguments for the chosen function. "
13
+ "Use only argument names/types defined in `tool_schemas`. "
14
+ "Never introduce extra argument names."
18
15
  )
19
16
 
20
17
  action_required_field_description = (
21
- "Specify whether the step requires actions to be "
22
- "performed. If **True**, the actions in `action_requests` "
23
- "must be performed. If **False**, the actions in "
24
- "`action_requests` are optional. If no tool_schemas"
25
- " are provided, this field is ignored."
18
+ "Whether this step strictly requires performing actions. "
19
+ "If true, the requests in `action_requests` must be fulfilled, "
20
+ "assuming `tool_schemas` are available. "
21
+ "If false or no `tool_schemas` exist, actions are optional."
26
22
  )
27
23
 
28
24
  action_requests_field_description = (
29
- "List of actions to be performed if `action_required` "
30
- "is **True**. Leave empty if no action is required. "
31
- "**When providing actions, you must choose from the "
32
- "provided `tool_schemas`. Do not invent function or "
33
- "argument names.**"
25
+ "List of actions to be executed when `action_required` is true. "
26
+ "Each action must align with the available `tool_schemas`. "
27
+ "Leave empty if no actions are needed."
34
28
  )
35
29
 
36
30
  confidence_description = (
37
- "Provide an objective numeric confidence score between 0 and 1 (with 3 "
38
- "decimal places) indicating how likely you successfully achieved the task"
39
- " according to user expectation. Interpret the score as:\n"
40
- "- **1**: Very confident in a good job.\n"
41
- "- **0**: Not confident at all.\n"
42
- "- **[0.8, 1]**: You can continue the path of reasoning if needed.\n"
43
- "- **[0.5, 0.8)**: Recheck your reasoning and consider reverting to a "
44
- "previous, more confident reasoning path.\n"
45
- "- **[0, 0.5)**: Stop because the reasoning is starting to be off track."
31
+ "Numeric confidence score (0.0 to 1.0, up to three decimals) indicating "
32
+ "how well you've met user expectations. Use this guide:\n"
33
+ " 1.0: Highly confident\n"
34
+ " • 0.8-1.0: Reasonably sure\n"
35
+ " 0.5-0.8: Re-check or refine\n"
36
+ " 0.0-0.5: Off track"
46
37
  )
47
38
 
48
39
  instruction_field_description = (
49
- "Define the core task or instruction to be executed. Your instruction should:\n\n"
50
- "1. Be specific and actionable\n"
51
- "2. Clearly state the expected outcome\n"
52
- "3. Include any critical constraints or requirements\n\n"
53
- "**Guidelines for writing effective instructions:**\n"
54
- "- Start with a clear action verb (e.g., analyze, create, evaluate)\n"
55
- "- Specify the scope and boundaries of the task\n"
56
- "- Include success criteria when applicable\n"
57
- "- Break complex tasks into distinct steps\n\n"
58
- "**Examples:**\n"
59
- "- 'Analyze the provided sales data and identify top 3 performing products'\n"
60
- "- 'Generate a Python function that validates email addresses'\n"
61
- "- 'Create a data visualization showing monthly revenue trends'"
40
+ "A clear, actionable task definition. Specify:\n"
41
+ "1) The primary goal or objective\n"
42
+ "2) Key success criteria or constraints\n"
43
+ "\n"
44
+ "Guidelines:\n"
45
+ "- Start with a direct action verb (e.g., 'Analyze', 'Generate', 'Create')\n"
46
+ "- Include scope, boundaries, or constraints\n"
47
+ "- Provide success criteria if relevant\n"
48
+ "- For complex tasks, break them into logical steps"
62
49
  )
63
50
 
64
51
  guidance_field_description = (
65
- "Provide strategic direction and constraints for task execution.\n\n"
66
- "**Key components to include:**\n"
67
- "1. Methodological preferences\n"
68
- "2. Quality standards and requirements\n"
69
- "3. Specific limitations or boundaries\n"
70
- "4. Performance expectations\n\n"
71
- "**Best practices:**\n"
72
- "- Be explicit about any assumptions that should be made\n"
73
- "- Specify preferred approaches or techniques\n"
74
- "- Detail any constraints on resources or methods\n"
75
- "- Include relevant standards or compliance requirements\n\n"
76
- "Leave as None if no specific guidance is needed beyond the instruction."
52
+ "Strategic direction and constraints for executing the task. "
53
+ "Include:\n"
54
+ "1) Preferred methods or frameworks\n"
55
+ "2) Quality benchmarks (e.g., speed, clarity)\n"
56
+ "3) Resource or environmental constraints\n"
57
+ "4) Relevant compliance or standards\n"
58
+ "Use None if no special guidance."
77
59
  )
78
60
 
79
61
  context_field_description = (
80
- "Supply essential background information and current state data required for "
81
- "task execution.\n\n"
82
- "**Include relevant details about:**\n"
83
- "1. Environmental conditions\n"
84
- "2. Historical context\n"
85
- "3. Related systems or processes\n"
86
- "4. Previous outcomes or decisions\n\n"
87
- "**Context should:**\n"
88
- "- Be directly relevant to the task\n"
89
- "- Provide necessary background without excess detail\n"
90
- "- Include any dependencies or prerequisites\n"
91
- "- Specify the current state of the system\n\n"
92
- "Set to None if no additional context is required."
62
+ "Background information and current-state data needed for the task. "
63
+ "Should be:\n"
64
+ "1) Directly relevant\n"
65
+ "2) Sufficient to perform the task\n"
66
+ "3) Free of extraneous detail\n"
67
+ "Include environment, prior outcomes, system states, or dependencies. "
68
+ "Use None if no additional context is needed."
93
69
  )
94
70
 
95
71
  reason_field_description = (
96
- "Control whether detailed reasoning should be included in the response.\n\n"
97
- "**When set to True:**\n"
98
- "- Must include a ReasonModel explaining decision rationale\n"
99
- "- Should detail key decision points\n"
100
- "- Must provide confidence scores for decisions\n"
101
- "- Should explain trade-offs considered\n\n"
102
- "**When set to False:**\n"
103
- "- Skip detailed reasoning\n"
104
- "- Focus on direct results\n"
105
- "- Omit confidence scoring\n\n"
106
- "Set to None to make reasoning optional based on context."
72
+ "Include a thoughtful explanation of decisions, trade-offs, "
73
+ "and insights. Encourage deeper introspection on why certain "
74
+ "choices were made, potential alternatives, and how confidence "
75
+ "was shaped. If not needed, set to None."
107
76
  )
108
77
 
109
78
  actions_field_description = (
110
- "Specify whether concrete actions should be taken as part of task execution.\n\n"
111
- "**When set to True:**\n"
112
- "- Must include appropriate ActionRequestModels\n"
113
- "- Actions should directly relate to task goals\n"
114
- "- Each action must be properly structured and validated\n"
115
- "- Actions must use available tool schemas\n\n"
116
- "**When set to False:**\n"
117
- "- No actions should be included\n"
118
- "- Focus on analysis and recommendations\n\n"
119
- "Set to None to make actions optional based on requirements."
120
- )
121
-
122
- # Example structures for each field to demonstrate proper formatting
123
- instruction_examples: list[JsonValue] = [
124
- "Analyze the dataset 'sales_2023.csv' and identify revenue trends",
125
- "Create a Python function to process customer feedback data",
126
- {
127
- "task": "data_analysis",
128
- "target": "sales_performance",
129
- "scope": ["revenue", "growth", "seasonality"],
130
- },
131
- ]
132
-
133
- guidance_examples: list[JsonValue] = [
134
- "Use statistical methods for trend analysis",
135
- "Optimize for readability and maintainability",
136
- {
137
- "methods": ["regression", "time_series"],
138
- "constraints": {"memory": "2GB", "time": "5min"},
139
- },
140
- ]
141
-
142
- context_examples: list[JsonValue] = [
143
- "Previous analysis showed seasonal patterns",
144
- {
145
- "prior_results": {"accuracy": 0.95},
146
- "system_state": "production",
147
- "dependencies": ["numpy", "pandas"],
148
- },
149
- ]
150
-
151
- """Field description for InstructModel."""
152
-
153
- instruct_model_description = (
154
- "Generate structured instructions for task execution.\n\n"
155
- "**Key Components:**\n"
156
- "1. Task Definition: Clear description of what needs to be accomplished\n"
157
- "2. Execution Parameters: How the task should be performed\n"
158
- "3. Success Criteria: What constitutes successful completion\n"
159
- "4. Scope and Boundaries: Limits and constraints of the task\n\n"
160
- "**Structure Guidelines:**\n"
161
- "- `instruction`: Core task or objective to accomplish\n"
162
- "- `guidance`: Parameters, preferences, and constraints\n"
163
- "- `context`: Relevant background and environmental information\n"
164
- "- `reason`: Whether to include reasoning in output\n"
165
- "- `actions`: Whether specific actions are required\n\n"
166
- "**Best Practices:**\n"
167
- "- Keep instructions clear and specific\n"
168
- "- Provide necessary but not excessive detail\n"
169
- "- Define measurable outcomes\n"
170
- "- Include relevant dependencies\n"
171
- "- Specify critical constraints\n\n"
172
- "**Common Issues to Avoid:**\n"
173
- "- Vague or ambiguous directives\n"
174
- "- Missing essential context\n"
175
- "- Undefined success criteria\n"
176
- "- Incomplete requirements\n"
177
- "- Conflicting parameters\n\n"
178
- "Structure instructions to enable successful task execution while maintaining "
179
- "appropriate flexibility for implementation details."
79
+ "Controls execution mode. "
80
+ "True: Execute specified actions. "
81
+ "False: Analysis/recommendations only. "
82
+ "None: Contextual execution."
180
83
  )
181
-
182
- instruct_model_examples = [
183
- {
184
- "instruction": "Process the input data according to specified requirements",
185
- "guidance": {
186
- "requirements": ["validation", "transformation", "aggregation"],
187
- "output_format": "structured_report",
188
- "quality_metrics": ["accuracy", "completeness"],
189
- },
190
- "context": {
191
- "input_source": "data_stream",
192
- "domain": "general",
193
- "priority": "standard",
194
- },
195
- "reason": True,
196
- "actions": True,
197
- },
198
- {
199
- "instruction": "Evaluate system performance against baseline metrics",
200
- "guidance": {
201
- "evaluation_criteria": [
202
- "response_time",
203
- "resource_usage",
204
- "error_rate",
205
- ],
206
- "methodology": "standard",
207
- "reporting": "detailed",
208
- },
209
- "context": {
210
- "environment": "test",
211
- "criticality": "medium",
212
- "constraints": {"time": "bounded"},
213
- },
214
- "reason": True,
215
- "actions": False,
216
- },
217
- ]
218
-
219
-
220
- __all__ = [
221
- "function_field_description",
222
- "arguments_field_description",
223
- "action_required_field_description",
224
- "action_requests_field_description",
225
- "confidence_description",
226
- "instruction_field_description",
227
- "guidance_field_description",
228
- "context_field_description",
229
- "reason_field_description",
230
- "actions_field_description",
231
- "instruction_examples",
232
- "guidance_examples",
233
- "context_examples",
234
- "instruct_model_description",
235
- "instruct_model_examples",
236
- ]
lionagi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.5.2"
1
+ __version__ = "0.5.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lionagi
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: An AGentic Intelligence Operating System.
5
5
  Author-email: HaiyangLi <quantocean.li@gmail.com>
6
6
  License: Apache License
@@ -336,7 +336,7 @@ pplx_small = iModel(
336
336
  b = await hunter.communicate(
337
337
  instruction="What makes a well-behaved dragon?",
338
338
  clear_messages=True, # refresh the conversation
339
- imodel=pplx_small, # use sonnet model
339
+ imodel=pplx_small, # use perplexity model
340
340
  )
341
341
 
342
342
  print(b)
@@ -1,6 +1,6 @@
1
- lionagi/__init__.py,sha256=TGvl3bsM1uF2XANOQxClkDGdDt_u5MxXFMEvwEvaYDw,442
1
+ lionagi/__init__.py,sha256=oybfu2VsZc4ElN7ZeaW3KQrz8T8EcSDHPA8lUE-8G2I,537
2
2
  lionagi/settings.py,sha256=BOjxRV4N9zQJervvajPhbaHmgZ-nhbCy7AaQJi3Avug,2726
3
- lionagi/version.py,sha256=isJrmDBLRag7Zc2UK9ZovWGOv7ji1Oh-zJtJMNJFkXw,22
3
+ lionagi/version.py,sha256=DITpct-LrdIsTgwx2NgH5Ghx5y8Xgz1YMimy1ZV5RTY,22
4
4
  lionagi/core/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
5
5
  lionagi/core/_class_registry.py,sha256=srSWefqCS9EZrMvyA8zCrZ9KFvzAhTIj8g6mJG5KlIc,1982
6
6
  lionagi/core/action/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
@@ -54,9 +54,9 @@ lionagi/core/models/operable_model.py,sha256=zuXDjoNI2-jLFxp3XWITtzIv0-CQ6FO6DQy
54
54
  lionagi/core/models/schema_model.py,sha256=H2tSX3r0U6MDNi929rWmAZy3nUKMP47RG-Ma0O-QYNY,667
55
55
  lionagi/core/models/types.py,sha256=elcUuz_9dx4AhZddnICF-Cs62VJWIBqMET7MiRe4c1I,447
56
56
  lionagi/core/session/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
57
- lionagi/core/session/branch.py,sha256=KxdfUnwxLUZlDN5axEmyel86UZDQ6mK_-NB1EQvy6jY,4320
57
+ lionagi/core/session/branch.py,sha256=r6yNXwTm0oYA-9YOereuvLJtDnhj9IJWJ5fjTyKN88U,4406
58
58
  lionagi/core/session/branch_mixins.py,sha256=C9lGHmD1AmXAePw0kGIeuZjZ7SzOrFcIwV6rVaGhoGg,19623
59
- lionagi/core/session/session.py,sha256=Uup50oMqs00ZH6zgEiqtk0pG_ANByHW_Ael07dfbT1M,5122
59
+ lionagi/core/session/session.py,sha256=cutece_iTs5K_m5soRfU9oTfHmw1icDEvx77E1RelIM,5129
60
60
  lionagi/core/session/types.py,sha256=MUGTSa2HWK79p7z-CG22RFP07N5AKnPVNXZwZt_wIvU,202
61
61
  lionagi/core/typing/__init__.py,sha256=Y9BK1OUXzjQgIo3epCVwWqUYhFwQQ_ayhRwI1UOmINg,228
62
62
  lionagi/core/typing/_concepts.py,sha256=uIzqfwtPBsIREhvT7NDAowc4i-u-69n_DRzLHzvHZO4,3730
@@ -257,7 +257,7 @@ lionagi/libs/func/throttle.py,sha256=iOOmS6i81NGRCClf4WaIhMMXwPt_rZ6WXYBqMJ_weEE
257
257
  lionagi/libs/func/types.py,sha256=wdjGNmY82pVACQBuDMUt3XJO0G9_wKHR7VesOeMxo_A,831
258
258
  lionagi/libs/func/utils.py,sha256=-LMdUEjksXP6JjjcUBh0XEQiXF30Zmv3xpKbmXjfya8,2674
259
259
  lionagi/libs/func/async_calls/__init__.py,sha256=qDHIkH7B-Ka5NJqeeyu_YL3TY36xL8kBwTjtCR4H8AU,495
260
- lionagi/libs/func/async_calls/alcall.py,sha256=U8-lWwqNwhe50Q07kzyW4YVcbx_LkUN5X1K1zvFg7i0,7283
260
+ lionagi/libs/func/async_calls/alcall.py,sha256=GhPXId0YLvfxpDSYOABwr_3D-nRu8aLWshaYboJQzmQ,7436
261
261
  lionagi/libs/func/async_calls/bcall.py,sha256=gwfKpRZkExjVn-1YGZfaboFES8RqUgyaBrdpNtz1IdY,4436
262
262
  lionagi/libs/func/async_calls/mcall.py,sha256=9O5gWbBT4iIqXfcdZjgAdqsOSLWrNS4_tt6ou231ozA,4607
263
263
  lionagi/libs/func/async_calls/pcall.py,sha256=6u3RJPV-3yOkWxC9iSoVFl1veFfZFJpR0QRyGtfBODI,5831
@@ -317,11 +317,11 @@ lionagi/libs/string_similarity/utils.py,sha256=NdD0qF5tuytWBsm0WMrH0gRBBSxw2p4-m
317
317
  lionagi/operations/__init__.py,sha256=Dt7o6DFP7zVR-uxZ4xsGHQcse3XVlF6S8Y9NhaUTn_4,68
318
318
  lionagi/operations/utils.py,sha256=kn5SkZRczl1aQ-vJBeVPlMdeyUUD0s5iyuAW4P6KOvQ,1164
319
319
  lionagi/operations/brainstorm/__init__.py,sha256=amsoH65wepsx58DfgH-TRTN1wDH5TC24qYI_f02zkVg,61
320
- lionagi/operations/brainstorm/brainstorm.py,sha256=fLTO5RFXHzGf7TDJXMV2tuPSYblPYtI52BCJnhHUoao,6273
321
- lionagi/operations/brainstorm/prompt.py,sha256=95t8SEEzaaEj0x0l5H5HsWaHSiPn-YqH9GaxaQYX0Dw,459
320
+ lionagi/operations/brainstorm/brainstorm.py,sha256=1Uuc11OH34jEYfDdombX5ui9b-bJTn4bVSLt0jjQUIc,16747
321
+ lionagi/operations/brainstorm/prompt.py,sha256=3a7LsmtiqGAK5mtWoX-2qhsjETBzBx8FxM3cFCBEoOo,497
322
322
  lionagi/operations/plan/__init__.py,sha256=SVqoVmlSGz9lsLztm487H2qOLwgyFxSi2yZ8ubn-bgE,43
323
- lionagi/operations/plan/plan.py,sha256=Ui8fFdRNLiD3RJmnKCwfY48yj0Fxxw2LBye0egYttWE,5611
324
- lionagi/operations/plan/prompt.py,sha256=ze79yFvZ_mBz4m-nS5ly9IK2PC43xl87_hfbwfj5jkw,763
323
+ lionagi/operations/plan/plan.py,sha256=AX4h_TeyhcXag572ywN9rmvo3fEiuGER7skAKf25_LY,15329
324
+ lionagi/operations/plan/prompt.py,sha256=sKHa_jDahzCJ60oILj1XNYCIlbS-H8ybKRXpf9zd5x0,880
325
325
  lionagi/operations/select/__init__.py,sha256=dUd-KS1l404_ueYlIQsVNhS9jAqjn5pJbtUEbbh6KlI,49
326
326
  lionagi/operations/select/prompt.py,sha256=wbmuDC96fcQ4LFKjqmeErOQwVRpGWRqcwUeLTWnbeNs,186
327
327
  lionagi/operations/select/select.py,sha256=2lQ8el8bQV1kaUF-r5IBfgaGhD2bvrLd9zwfqvcWYgk,3164
@@ -340,9 +340,9 @@ lionagi/protocols/configs/retry_config.py,sha256=pZwV-iV7YoyPpJgSJTbIXYjOKQjzudn
340
340
  lionagi/protocols/configs/types.py,sha256=8CFN8Lv6F0aJ4Xy7pslnpNTe18dBFaddvzOrAsZuOp0,383
341
341
  lionagi/protocols/operatives/__init__.py,sha256=v8vNyJVIVj8_Oz9RJdVe6ZKUQMYTgDh1VQpnr1KdLaw,112
342
342
  lionagi/protocols/operatives/action.py,sha256=cWIyehhB750Sp1w9jPTV-DXcQRLhCFNp2TXHysQvGLU,4854
343
- lionagi/protocols/operatives/instruct.py,sha256=WRtFi-bxgmymVNBU-nw6wpM2qcWcU7btCf2MFEC3Pq8,5311
343
+ lionagi/protocols/operatives/instruct.py,sha256=XCIkNkuP0Dd7ZOnCpuC2iYuufW9_H8ue5imyqduqQgs,5142
344
344
  lionagi/protocols/operatives/operative.py,sha256=jGsnPSn7LeJE9H-fGjHYIY2N_QgclZpmch8tlshUMcg,6620
345
- lionagi/protocols/operatives/prompts.py,sha256=-ZGLS1Cbv1ll9-I-GIyAuqT01PRMwOhxcn4z3Ek3ibA,8984
345
+ lionagi/protocols/operatives/prompts.py,sha256=JRJBPiAAccB50sGY2FDIDvSehfc-sCbYLgWmH4BUwBs,2978
346
346
  lionagi/protocols/operatives/reason.py,sha256=i5iIr0xdMISbrJ_u6fQO4MZy0aceX8nYcETVfHILh-8,1441
347
347
  lionagi/protocols/operatives/step.py,sha256=ePFmRyuJ0v_X9BVgzkFAv8afqnic6Zmjt4MGzlCeLpk,8155
348
348
  lionagi/protocols/operatives/types.py,sha256=SPFX2EHHoJF2ZMgxoJrNlf02QlcAk7ijup6kY5GhrK0,463
@@ -368,7 +368,7 @@ lionagi/strategies/sequential_chunk.py,sha256=jG_WZXG-Ra3yd30CmX4b3XeCNAUrZGA2-i
368
368
  lionagi/strategies/sequential_concurrent_chunk.py,sha256=H7GShaqYlD5XxNJMG2GdOR4Vl8JHDhZb5jxNq8zY0hI,3365
369
369
  lionagi/strategies/types.py,sha256=fEvE4d1H4SeCcXcd2dz3q4k8jFIBtxYzjxDN7eJRLtI,769
370
370
  lionagi/strategies/utils.py,sha256=DX1dvxia8cNRqEJJbssJ3mgRzo7kgWCTA4y5DYLCCZE,1281
371
- lionagi-0.5.2.dist-info/METADATA,sha256=V8Q9Mtjss6_gk1rH4myIQa-HMUw66XV4S3GRa54p9WY,22736
372
- lionagi-0.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
- lionagi-0.5.2.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
374
- lionagi-0.5.2.dist-info/RECORD,,
371
+ lionagi-0.5.4.dist-info/METADATA,sha256=or-K2I6vye-JTu559FMXpy14cZlI5_3xLAgLCURMu1w,22736
372
+ lionagi-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
+ lionagi-0.5.4.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
374
+ lionagi-0.5.4.dist-info/RECORD,,