kweaver-dolphin 0.1.0__py3-none-any.whl
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.
- DolphinLanguageSDK/__init__.py +58 -0
- dolphin/__init__.py +62 -0
- dolphin/cli/__init__.py +20 -0
- dolphin/cli/args/__init__.py +9 -0
- dolphin/cli/args/parser.py +567 -0
- dolphin/cli/builtin_agents/__init__.py +22 -0
- dolphin/cli/commands/__init__.py +4 -0
- dolphin/cli/interrupt/__init__.py +8 -0
- dolphin/cli/interrupt/handler.py +205 -0
- dolphin/cli/interrupt/keyboard.py +82 -0
- dolphin/cli/main.py +49 -0
- dolphin/cli/multimodal/__init__.py +34 -0
- dolphin/cli/multimodal/clipboard.py +327 -0
- dolphin/cli/multimodal/handler.py +249 -0
- dolphin/cli/multimodal/image_processor.py +214 -0
- dolphin/cli/multimodal/input_parser.py +149 -0
- dolphin/cli/runner/__init__.py +8 -0
- dolphin/cli/runner/runner.py +989 -0
- dolphin/cli/ui/__init__.py +10 -0
- dolphin/cli/ui/console.py +2795 -0
- dolphin/cli/ui/input.py +340 -0
- dolphin/cli/ui/layout.py +425 -0
- dolphin/cli/ui/stream_renderer.py +302 -0
- dolphin/cli/utils/__init__.py +8 -0
- dolphin/cli/utils/helpers.py +135 -0
- dolphin/cli/utils/version.py +49 -0
- dolphin/core/__init__.py +107 -0
- dolphin/core/agent/__init__.py +10 -0
- dolphin/core/agent/agent_state.py +69 -0
- dolphin/core/agent/base_agent.py +970 -0
- dolphin/core/code_block/__init__.py +0 -0
- dolphin/core/code_block/agent_init_block.py +0 -0
- dolphin/core/code_block/assign_block.py +98 -0
- dolphin/core/code_block/basic_code_block.py +1865 -0
- dolphin/core/code_block/explore_block.py +1327 -0
- dolphin/core/code_block/explore_block_v2.py +712 -0
- dolphin/core/code_block/explore_strategy.py +672 -0
- dolphin/core/code_block/judge_block.py +220 -0
- dolphin/core/code_block/prompt_block.py +32 -0
- dolphin/core/code_block/skill_call_deduplicator.py +291 -0
- dolphin/core/code_block/tool_block.py +129 -0
- dolphin/core/common/__init__.py +17 -0
- dolphin/core/common/constants.py +176 -0
- dolphin/core/common/enums.py +1173 -0
- dolphin/core/common/exceptions.py +133 -0
- dolphin/core/common/multimodal.py +539 -0
- dolphin/core/common/object_type.py +165 -0
- dolphin/core/common/output_format.py +432 -0
- dolphin/core/common/types.py +36 -0
- dolphin/core/config/__init__.py +16 -0
- dolphin/core/config/global_config.py +1289 -0
- dolphin/core/config/ontology_config.py +133 -0
- dolphin/core/context/__init__.py +12 -0
- dolphin/core/context/context.py +1580 -0
- dolphin/core/context/context_manager.py +161 -0
- dolphin/core/context/var_output.py +82 -0
- dolphin/core/context/variable_pool.py +356 -0
- dolphin/core/context_engineer/__init__.py +41 -0
- dolphin/core/context_engineer/config/__init__.py +5 -0
- dolphin/core/context_engineer/config/settings.py +402 -0
- dolphin/core/context_engineer/core/__init__.py +7 -0
- dolphin/core/context_engineer/core/budget_manager.py +327 -0
- dolphin/core/context_engineer/core/context_assembler.py +583 -0
- dolphin/core/context_engineer/core/context_manager.py +637 -0
- dolphin/core/context_engineer/core/tokenizer_service.py +260 -0
- dolphin/core/context_engineer/example/incremental_example.py +267 -0
- dolphin/core/context_engineer/example/traditional_example.py +334 -0
- dolphin/core/context_engineer/services/__init__.py +5 -0
- dolphin/core/context_engineer/services/compressor.py +399 -0
- dolphin/core/context_engineer/utils/__init__.py +6 -0
- dolphin/core/context_engineer/utils/context_utils.py +441 -0
- dolphin/core/context_engineer/utils/message_formatter.py +270 -0
- dolphin/core/context_engineer/utils/token_utils.py +139 -0
- dolphin/core/coroutine/__init__.py +15 -0
- dolphin/core/coroutine/context_snapshot.py +154 -0
- dolphin/core/coroutine/context_snapshot_profile.py +922 -0
- dolphin/core/coroutine/context_snapshot_store.py +268 -0
- dolphin/core/coroutine/execution_frame.py +145 -0
- dolphin/core/coroutine/execution_state_registry.py +161 -0
- dolphin/core/coroutine/resume_handle.py +101 -0
- dolphin/core/coroutine/step_result.py +101 -0
- dolphin/core/executor/__init__.py +18 -0
- dolphin/core/executor/debug_controller.py +630 -0
- dolphin/core/executor/dolphin_executor.py +1063 -0
- dolphin/core/executor/executor.py +624 -0
- dolphin/core/flags/__init__.py +27 -0
- dolphin/core/flags/definitions.py +49 -0
- dolphin/core/flags/manager.py +113 -0
- dolphin/core/hook/__init__.py +95 -0
- dolphin/core/hook/expression_evaluator.py +499 -0
- dolphin/core/hook/hook_dispatcher.py +380 -0
- dolphin/core/hook/hook_types.py +248 -0
- dolphin/core/hook/isolated_variable_pool.py +284 -0
- dolphin/core/interfaces.py +53 -0
- dolphin/core/llm/__init__.py +0 -0
- dolphin/core/llm/llm.py +495 -0
- dolphin/core/llm/llm_call.py +100 -0
- dolphin/core/llm/llm_client.py +1285 -0
- dolphin/core/llm/message_sanitizer.py +120 -0
- dolphin/core/logging/__init__.py +20 -0
- dolphin/core/logging/logger.py +526 -0
- dolphin/core/message/__init__.py +8 -0
- dolphin/core/message/compressor.py +749 -0
- dolphin/core/parser/__init__.py +8 -0
- dolphin/core/parser/parser.py +405 -0
- dolphin/core/runtime/__init__.py +10 -0
- dolphin/core/runtime/runtime_graph.py +926 -0
- dolphin/core/runtime/runtime_instance.py +446 -0
- dolphin/core/skill/__init__.py +14 -0
- dolphin/core/skill/context_retention.py +157 -0
- dolphin/core/skill/skill_function.py +686 -0
- dolphin/core/skill/skill_matcher.py +282 -0
- dolphin/core/skill/skillkit.py +700 -0
- dolphin/core/skill/skillset.py +72 -0
- dolphin/core/trajectory/__init__.py +10 -0
- dolphin/core/trajectory/recorder.py +189 -0
- dolphin/core/trajectory/trajectory.py +522 -0
- dolphin/core/utils/__init__.py +9 -0
- dolphin/core/utils/cache_kv.py +212 -0
- dolphin/core/utils/tools.py +340 -0
- dolphin/lib/__init__.py +93 -0
- dolphin/lib/debug/__init__.py +8 -0
- dolphin/lib/debug/visualizer.py +409 -0
- dolphin/lib/memory/__init__.py +28 -0
- dolphin/lib/memory/async_processor.py +220 -0
- dolphin/lib/memory/llm_calls.py +195 -0
- dolphin/lib/memory/manager.py +78 -0
- dolphin/lib/memory/sandbox.py +46 -0
- dolphin/lib/memory/storage.py +245 -0
- dolphin/lib/memory/utils.py +51 -0
- dolphin/lib/ontology/__init__.py +12 -0
- dolphin/lib/ontology/basic/__init__.py +0 -0
- dolphin/lib/ontology/basic/base.py +102 -0
- dolphin/lib/ontology/basic/concept.py +130 -0
- dolphin/lib/ontology/basic/object.py +11 -0
- dolphin/lib/ontology/basic/relation.py +63 -0
- dolphin/lib/ontology/datasource/__init__.py +27 -0
- dolphin/lib/ontology/datasource/datasource.py +66 -0
- dolphin/lib/ontology/datasource/oracle_datasource.py +338 -0
- dolphin/lib/ontology/datasource/sql.py +845 -0
- dolphin/lib/ontology/mapping.py +177 -0
- dolphin/lib/ontology/ontology.py +733 -0
- dolphin/lib/ontology/ontology_context.py +16 -0
- dolphin/lib/ontology/ontology_manager.py +107 -0
- dolphin/lib/skill_results/__init__.py +31 -0
- dolphin/lib/skill_results/cache_backend.py +559 -0
- dolphin/lib/skill_results/result_processor.py +181 -0
- dolphin/lib/skill_results/result_reference.py +179 -0
- dolphin/lib/skill_results/skillkit_hook.py +324 -0
- dolphin/lib/skill_results/strategies.py +328 -0
- dolphin/lib/skill_results/strategy_registry.py +150 -0
- dolphin/lib/skillkits/__init__.py +44 -0
- dolphin/lib/skillkits/agent_skillkit.py +155 -0
- dolphin/lib/skillkits/cognitive_skillkit.py +82 -0
- dolphin/lib/skillkits/env_skillkit.py +250 -0
- dolphin/lib/skillkits/mcp_adapter.py +616 -0
- dolphin/lib/skillkits/mcp_skillkit.py +771 -0
- dolphin/lib/skillkits/memory_skillkit.py +650 -0
- dolphin/lib/skillkits/noop_skillkit.py +31 -0
- dolphin/lib/skillkits/ontology_skillkit.py +89 -0
- dolphin/lib/skillkits/plan_act_skillkit.py +452 -0
- dolphin/lib/skillkits/resource/__init__.py +52 -0
- dolphin/lib/skillkits/resource/models/__init__.py +6 -0
- dolphin/lib/skillkits/resource/models/skill_config.py +109 -0
- dolphin/lib/skillkits/resource/models/skill_meta.py +127 -0
- dolphin/lib/skillkits/resource/resource_skillkit.py +393 -0
- dolphin/lib/skillkits/resource/skill_cache.py +215 -0
- dolphin/lib/skillkits/resource/skill_loader.py +395 -0
- dolphin/lib/skillkits/resource/skill_validator.py +406 -0
- dolphin/lib/skillkits/resource_skillkit.py +11 -0
- dolphin/lib/skillkits/search_skillkit.py +163 -0
- dolphin/lib/skillkits/sql_skillkit.py +274 -0
- dolphin/lib/skillkits/system_skillkit.py +509 -0
- dolphin/lib/skillkits/vm_skillkit.py +65 -0
- dolphin/lib/utils/__init__.py +9 -0
- dolphin/lib/utils/data_process.py +207 -0
- dolphin/lib/utils/handle_progress.py +178 -0
- dolphin/lib/utils/security.py +139 -0
- dolphin/lib/utils/text_retrieval.py +462 -0
- dolphin/lib/vm/__init__.py +11 -0
- dolphin/lib/vm/env_executor.py +895 -0
- dolphin/lib/vm/python_session_manager.py +453 -0
- dolphin/lib/vm/vm.py +610 -0
- dolphin/sdk/__init__.py +60 -0
- dolphin/sdk/agent/__init__.py +12 -0
- dolphin/sdk/agent/agent_factory.py +236 -0
- dolphin/sdk/agent/dolphin_agent.py +1106 -0
- dolphin/sdk/api/__init__.py +4 -0
- dolphin/sdk/runtime/__init__.py +8 -0
- dolphin/sdk/runtime/env.py +363 -0
- dolphin/sdk/skill/__init__.py +10 -0
- dolphin/sdk/skill/global_skills.py +706 -0
- dolphin/sdk/skill/traditional_toolkit.py +260 -0
- kweaver_dolphin-0.1.0.dist-info/METADATA +521 -0
- kweaver_dolphin-0.1.0.dist-info/RECORD +199 -0
- kweaver_dolphin-0.1.0.dist-info/WHEEL +5 -0
- kweaver_dolphin-0.1.0.dist-info/entry_points.txt +27 -0
- kweaver_dolphin-0.1.0.dist-info/licenses/LICENSE.txt +201 -0
- kweaver_dolphin-0.1.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
from typing import Dict, List, Any, Callable
|
|
2
|
+
from dolphin.core.skill.skillkit import Skillkit
|
|
3
|
+
from dolphin.core.skill.skill_function import SkillFunction
|
|
4
|
+
from dolphin.core.utils.tools import Tool
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TriditionalToolkit(Skillkit):
|
|
8
|
+
"""
|
|
9
|
+
Traditional toolkit that wraps Tools as OpenAI Functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, tools: Dict[str, Tool] = None):
|
|
13
|
+
"""
|
|
14
|
+
Initialize with a dictionary of tools
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
tools: Dictionary mapping tool names to Tool instances
|
|
18
|
+
"""
|
|
19
|
+
super().__init__()
|
|
20
|
+
self.tools = tools or {}
|
|
21
|
+
self.openai_functions = self._create_openai_functions()
|
|
22
|
+
|
|
23
|
+
def getName(self) -> str:
|
|
24
|
+
"""Get the toolkit name"""
|
|
25
|
+
return "triditional_toolkit"
|
|
26
|
+
|
|
27
|
+
def _createSkills(self) -> List[SkillFunction]:
|
|
28
|
+
"""Create all skill functions wrapped from tools"""
|
|
29
|
+
return list(self.openai_functions.values())
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def buildFromTooldict(tooldict: Dict[str, Tool]) -> "TriditionalToolkit":
|
|
33
|
+
"""
|
|
34
|
+
Build TriditionalToolkit from a dictionary of tools
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
tooldict: Dictionary mapping tool names to Tool instances
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
TriditionalToolkit instance
|
|
41
|
+
"""
|
|
42
|
+
return TriditionalToolkit(tooldict)
|
|
43
|
+
|
|
44
|
+
def _create_openai_functions(self) -> Dict[str, SkillFunction]:
|
|
45
|
+
"""
|
|
46
|
+
Create skill functions from the tools
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
Dictionary mapping function names to SkillFunction instances
|
|
50
|
+
"""
|
|
51
|
+
openai_functions = {}
|
|
52
|
+
|
|
53
|
+
for tool_name, tool in self.tools.items():
|
|
54
|
+
# Create a wrapper function for the tool
|
|
55
|
+
wrapper_func = self._create_tool_wrapper(tool, tool_name)
|
|
56
|
+
|
|
57
|
+
# Create OpenAI tool schema from tool's metadata, use tool_name as function name
|
|
58
|
+
openai_tool_schema = self._tool_to_openai_schema(tool, tool_name)
|
|
59
|
+
|
|
60
|
+
# Create SkillFunction with custom schema and tool type information
|
|
61
|
+
openai_function = SkillFunction(
|
|
62
|
+
func=wrapper_func,
|
|
63
|
+
openai_tool_schema=openai_tool_schema,
|
|
64
|
+
result_process_strategies=tool.result_process_strategy_cfg,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Add tool type information to the SkillFunction
|
|
68
|
+
openai_function.original_tool = tool
|
|
69
|
+
|
|
70
|
+
openai_functions[tool_name] = openai_function
|
|
71
|
+
|
|
72
|
+
return openai_functions
|
|
73
|
+
|
|
74
|
+
def _create_tool_wrapper(self, tool: Tool, tool_name: str) -> Callable:
|
|
75
|
+
"""
|
|
76
|
+
Create a wrapper function for the tool that matches OpenAI function signature
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
tool: The Tool instance to wrap
|
|
80
|
+
tool_name: The name to use for the function
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Callable wrapper function (async generator for streaming tools)
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
async def async_wrapper(**kwargs):
|
|
87
|
+
"""
|
|
88
|
+
Async wrapper function that calls the tool's method
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
**kwargs: Arguments to pass to the tool (should include tool_input and optionally props)
|
|
92
|
+
|
|
93
|
+
Yields:
|
|
94
|
+
Tool execution results (streaming for tools with stream methods)
|
|
95
|
+
"""
|
|
96
|
+
# Merge parameters to avoid duplicate keyword arguments
|
|
97
|
+
tool_kwargs = {}
|
|
98
|
+
if "tool_input" in kwargs:
|
|
99
|
+
# If tool_input is a dictionary, unpack its contents
|
|
100
|
+
tool_input = kwargs["tool_input"]
|
|
101
|
+
if isinstance(tool_input, dict):
|
|
102
|
+
tool_kwargs.update(tool_input)
|
|
103
|
+
else:
|
|
104
|
+
tool_kwargs["tool_input"] = tool_input
|
|
105
|
+
|
|
106
|
+
# Process the props parameter to avoid duplication
|
|
107
|
+
if "props" in kwargs:
|
|
108
|
+
tool_kwargs["props"] = kwargs["props"]
|
|
109
|
+
|
|
110
|
+
# Add additional parameters
|
|
111
|
+
for key, value in kwargs.items():
|
|
112
|
+
if key not in ["tool_input", "props"]:
|
|
113
|
+
tool_kwargs[key] = value
|
|
114
|
+
|
|
115
|
+
# Priority order: arun_stream > run_stream > run
|
|
116
|
+
if hasattr(tool, "arun_stream"):
|
|
117
|
+
# For async streaming tools, yield each result as it comes
|
|
118
|
+
async_gen = tool.arun_stream(**kwargs)
|
|
119
|
+
async for result in async_gen:
|
|
120
|
+
yield result
|
|
121
|
+
elif hasattr(tool, "run_stream"):
|
|
122
|
+
# For sync streaming tools, convert to async generator
|
|
123
|
+
sync_gen = tool.run_stream(**kwargs)
|
|
124
|
+
for result in sync_gen:
|
|
125
|
+
yield result
|
|
126
|
+
elif hasattr(tool, "run"):
|
|
127
|
+
# For non-streaming tools, yield single result
|
|
128
|
+
result = tool.run(**kwargs)
|
|
129
|
+
yield result
|
|
130
|
+
else:
|
|
131
|
+
raise ValueError(
|
|
132
|
+
f"Tool {tool_name} has no run, run_stream, or arun_stream method"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# Set function metadata for OpenAI schema generation
|
|
136
|
+
async_wrapper.__name__ = tool_name
|
|
137
|
+
async_wrapper.__doc__ = self._generate_function_docstring(tool)
|
|
138
|
+
|
|
139
|
+
return async_wrapper
|
|
140
|
+
|
|
141
|
+
def _generate_function_docstring(self, tool: Tool) -> str:
|
|
142
|
+
"""
|
|
143
|
+
Generate a docstring for the wrapper function based on tool metadata
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
tool: The Tool instance
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Formatted docstring
|
|
150
|
+
"""
|
|
151
|
+
docstring_parts = [tool.description]
|
|
152
|
+
|
|
153
|
+
if tool.inputs:
|
|
154
|
+
docstring_parts.append("\nArgs:")
|
|
155
|
+
for param_name, param_info in tool.inputs.items():
|
|
156
|
+
param_desc = param_info.get("description", "")
|
|
157
|
+
param_type = param_info.get("type", "Any")
|
|
158
|
+
required = param_info.get("required", True)
|
|
159
|
+
required_text = " (required)" if required else " (optional)"
|
|
160
|
+
docstring_parts.append(
|
|
161
|
+
f" {param_name} ({param_type}): {param_desc}{required_text}"
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
if tool.outputs:
|
|
165
|
+
docstring_parts.append("\nReturns:")
|
|
166
|
+
for output_name, output_info in tool.outputs.items():
|
|
167
|
+
output_desc = output_info.get("description", "")
|
|
168
|
+
output_type = output_info.get("type", "Any")
|
|
169
|
+
docstring_parts.append(f" {output_type}: {output_desc}")
|
|
170
|
+
|
|
171
|
+
return "\n".join(docstring_parts)
|
|
172
|
+
|
|
173
|
+
def _tool_to_openai_schema(self, tool: Tool, tool_name: str) -> Dict[str, Any]:
|
|
174
|
+
"""
|
|
175
|
+
Convert Tool metadata to OpenAI tool schema
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
tool: The Tool instance
|
|
179
|
+
tool_name: The name to use for the function
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
OpenAI tool schema dictionary
|
|
183
|
+
"""
|
|
184
|
+
# Build parameters schema from tool inputs
|
|
185
|
+
if hasattr(tool, "inputs_schema") and tool.inputs_schema:
|
|
186
|
+
parameters_schema = tool.inputs_schema
|
|
187
|
+
else:
|
|
188
|
+
properties = {}
|
|
189
|
+
required = []
|
|
190
|
+
|
|
191
|
+
for param_name, param_info in tool.inputs.items():
|
|
192
|
+
param_type = param_info.get("type", "string")
|
|
193
|
+
param_desc = param_info.get("description", "")
|
|
194
|
+
is_required = param_info.get("required", True)
|
|
195
|
+
|
|
196
|
+
# Convert type to JSON schema type
|
|
197
|
+
json_type = self._convert_type_to_json_schema(param_type)
|
|
198
|
+
|
|
199
|
+
properties[param_name] = {"type": json_type, "description": param_desc}
|
|
200
|
+
|
|
201
|
+
if is_required:
|
|
202
|
+
required.append(param_name)
|
|
203
|
+
|
|
204
|
+
parameters_schema = {"type": "object", "properties": properties}
|
|
205
|
+
|
|
206
|
+
if required:
|
|
207
|
+
parameters_schema["required"] = required
|
|
208
|
+
|
|
209
|
+
# Build complete OpenAI tool schema
|
|
210
|
+
openai_tool_schema = {
|
|
211
|
+
"type": "function",
|
|
212
|
+
"function": {
|
|
213
|
+
"name": tool_name,
|
|
214
|
+
"description": tool.description,
|
|
215
|
+
"parameters": parameters_schema,
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return openai_tool_schema
|
|
220
|
+
|
|
221
|
+
def _convert_type_to_json_schema(self, param_type: Any) -> str:
|
|
222
|
+
"""
|
|
223
|
+
Convert parameter type to JSON schema type
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
param_type: Parameter type (can be str, type, or other)
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
JSON schema type string
|
|
230
|
+
"""
|
|
231
|
+
if isinstance(param_type, str):
|
|
232
|
+
type_mapping = {
|
|
233
|
+
"string": "string",
|
|
234
|
+
"str": "string",
|
|
235
|
+
"int": "integer",
|
|
236
|
+
"integer": "integer",
|
|
237
|
+
"float": "number",
|
|
238
|
+
"number": "number",
|
|
239
|
+
"bool": "boolean",
|
|
240
|
+
"boolean": "boolean",
|
|
241
|
+
"list": "array",
|
|
242
|
+
"array": "array",
|
|
243
|
+
"dict": "object",
|
|
244
|
+
"object": "object",
|
|
245
|
+
}
|
|
246
|
+
return type_mapping.get(param_type.lower(), "string")
|
|
247
|
+
elif param_type is str:
|
|
248
|
+
return "string"
|
|
249
|
+
elif param_type is int:
|
|
250
|
+
return "integer"
|
|
251
|
+
elif param_type is float:
|
|
252
|
+
return "number"
|
|
253
|
+
elif param_type is bool:
|
|
254
|
+
return "boolean"
|
|
255
|
+
elif param_type is list:
|
|
256
|
+
return "array"
|
|
257
|
+
elif param_type is dict:
|
|
258
|
+
return "object"
|
|
259
|
+
else:
|
|
260
|
+
return "string" # Default fallback
|