alita-sdk 0.3.357__py3-none-any.whl → 0.3.359__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.
Potentially problematic release.
This version of alita-sdk might be problematic. Click here for more details.
- alita_sdk/runtime/clients/client.py +45 -0
- alita_sdk/runtime/langchain/assistant.py +14 -1
- alita_sdk/runtime/tools/__init__.py +5 -2
- alita_sdk/runtime/tools/image_generation.py +116 -0
- alita_sdk/runtime/tools/llm.py +20 -6
- alita_sdk/tools/qtest/__init__.py +7 -2
- alita_sdk/tools/qtest/api_wrapper.py +40 -11
- {alita_sdk-0.3.357.dist-info → alita_sdk-0.3.359.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.357.dist-info → alita_sdk-0.3.359.dist-info}/RECORD +12 -11
- {alita_sdk-0.3.357.dist-info → alita_sdk-0.3.359.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.357.dist-info → alita_sdk-0.3.359.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.357.dist-info → alita_sdk-0.3.359.dist-info}/top_level.txt +0 -0
|
@@ -68,8 +68,10 @@ class AlitaClient:
|
|
|
68
68
|
self.bucket_url = f"{self.base_url}{self.api_path}/artifacts/buckets/{self.project_id}"
|
|
69
69
|
self.configurations_url = f'{self.base_url}{self.api_path}/integrations/integrations/default/{self.project_id}?section=configurations&unsecret=true'
|
|
70
70
|
self.ai_section_url = f'{self.base_url}{self.api_path}/integrations/integrations/default/{self.project_id}?section=ai'
|
|
71
|
+
self.image_generation_url = f"{self.base_url}{self.llm_path}/images/generations"
|
|
71
72
|
self.configurations: list = configurations or []
|
|
72
73
|
self.model_timeout = kwargs.get('model_timeout', 120)
|
|
74
|
+
self.model_image_generation = kwargs.get('model_image_generation')
|
|
73
75
|
|
|
74
76
|
def get_mcp_toolkits(self):
|
|
75
77
|
if user_id := self._get_real_user_id():
|
|
@@ -218,6 +220,49 @@ class AlitaClient:
|
|
|
218
220
|
openai_organization=str(self.project_id),
|
|
219
221
|
)
|
|
220
222
|
|
|
223
|
+
def generate_image(self,
|
|
224
|
+
prompt: str,
|
|
225
|
+
n: int = 1,
|
|
226
|
+
size: str = "auto",
|
|
227
|
+
quality: str = "auto",
|
|
228
|
+
response_format: str = "b64_json",
|
|
229
|
+
style: Optional[str] = None) -> dict:
|
|
230
|
+
|
|
231
|
+
if not self.model_image_generation:
|
|
232
|
+
raise ValueError("Image generation model is not configured for this client")
|
|
233
|
+
|
|
234
|
+
# Prepare the request data
|
|
235
|
+
image_generation_data = {
|
|
236
|
+
"prompt": prompt,
|
|
237
|
+
"model": self.model_image_generation,
|
|
238
|
+
"n": n,
|
|
239
|
+
"size": size,
|
|
240
|
+
"quality": quality,
|
|
241
|
+
"response_format": response_format,
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if style:
|
|
245
|
+
image_generation_data["style"] = style
|
|
246
|
+
|
|
247
|
+
logger.info(f"Generating image with model: {self.model_image_generation}, prompt: {prompt[:50]}...")
|
|
248
|
+
|
|
249
|
+
try:
|
|
250
|
+
response = requests.post(
|
|
251
|
+
self.image_generation_url,
|
|
252
|
+
headers=self.headers,
|
|
253
|
+
json=image_generation_data,
|
|
254
|
+
verify=False,
|
|
255
|
+
timeout=self.model_timeout
|
|
256
|
+
)
|
|
257
|
+
response.raise_for_status()
|
|
258
|
+
return response.json()
|
|
259
|
+
|
|
260
|
+
except requests.exceptions.HTTPError as e:
|
|
261
|
+
logger.error(f"Image generation failed: {e.response.status_code} - {e.response.text}")
|
|
262
|
+
raise
|
|
263
|
+
except requests.exceptions.RequestException as e:
|
|
264
|
+
logger.error(f"Image generation request failed: {e}")
|
|
265
|
+
raise
|
|
221
266
|
|
|
222
267
|
def get_app_version_details(self, application_id: int, application_version_id: int) -> dict:
|
|
223
268
|
url = f"{self.application_versions}/{application_id}/{application_version_id}"
|
|
@@ -38,7 +38,8 @@ class Assistant:
|
|
|
38
38
|
|
|
39
39
|
logger.debug("Data for agent creation: %s", data)
|
|
40
40
|
logger.info("App type: %s", app_type)
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
self.alita_client = alita
|
|
42
43
|
self.client = client
|
|
43
44
|
# For predict agents, use the client as-is since it's already configured
|
|
44
45
|
# if app_type == "predict":
|
|
@@ -192,6 +193,18 @@ class Assistant:
|
|
|
192
193
|
except Exception as e:
|
|
193
194
|
logger.error(f"Error adding PyodideSandboxTool: {e}")
|
|
194
195
|
|
|
196
|
+
# Add image generation tool if model is configured
|
|
197
|
+
if self.alita_client.model_image_generation is not None:
|
|
198
|
+
try:
|
|
199
|
+
from ..tools.image_generation import (
|
|
200
|
+
create_image_generation_tool
|
|
201
|
+
)
|
|
202
|
+
image_tool = create_image_generation_tool(self.alita_client)
|
|
203
|
+
simple_tools.append(image_tool)
|
|
204
|
+
logger.info("Added ImageGenerationTool to react agent")
|
|
205
|
+
except Exception as e:
|
|
206
|
+
logger.error(f"Error adding ImageGenerationTool: {e}")
|
|
207
|
+
|
|
195
208
|
# Set up memory/checkpointer if available
|
|
196
209
|
checkpointer = None
|
|
197
210
|
if self.memory is not None:
|
|
@@ -5,10 +5,13 @@ This module provides various tools that can be used within LangGraph agents.
|
|
|
5
5
|
|
|
6
6
|
from .sandbox import PyodideSandboxTool, StatefulPyodideSandboxTool, create_sandbox_tool
|
|
7
7
|
from .echo import EchoTool
|
|
8
|
+
from .image_generation import ImageGenerationTool, create_image_generation_tool
|
|
8
9
|
|
|
9
10
|
__all__ = [
|
|
10
11
|
"PyodideSandboxTool",
|
|
11
|
-
"StatefulPyodideSandboxTool",
|
|
12
|
+
"StatefulPyodideSandboxTool",
|
|
12
13
|
"create_sandbox_tool",
|
|
13
|
-
"EchoTool"
|
|
14
|
+
"EchoTool",
|
|
15
|
+
"ImageGenerationTool",
|
|
16
|
+
"create_image_generation_tool"
|
|
14
17
|
]
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Image generation tool for Alita SDK.
|
|
3
|
+
"""
|
|
4
|
+
import logging
|
|
5
|
+
from typing import Optional, Type, Any
|
|
6
|
+
from langchain_core.tools import BaseTool
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ImageGenerationInput(BaseModel):
|
|
13
|
+
"""Input schema for image generation tool."""
|
|
14
|
+
prompt: str = Field(description="Text prompt describing the image to generate")
|
|
15
|
+
n: int = Field(
|
|
16
|
+
default=1, description="Number of images to generate (1-10)",
|
|
17
|
+
ge=1, le=10
|
|
18
|
+
)
|
|
19
|
+
size: str = Field(
|
|
20
|
+
default="auto",
|
|
21
|
+
description="Size of the generated image (e.g., '1024x1024')"
|
|
22
|
+
)
|
|
23
|
+
quality: str = Field(
|
|
24
|
+
default="auto",
|
|
25
|
+
description="Quality of the generated image ('low', 'medium', 'high', 'auto')"
|
|
26
|
+
)
|
|
27
|
+
style: Optional[str] = Field(
|
|
28
|
+
default=None, description="Style of the generated image (optional)"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ImageGenerationTool(BaseTool):
|
|
33
|
+
"""Tool for generating images using the Alita client."""
|
|
34
|
+
|
|
35
|
+
name: str = "generate_image"
|
|
36
|
+
description: str = "Generate images from text prompts using AI models"
|
|
37
|
+
args_schema: Type[BaseModel] = ImageGenerationInput
|
|
38
|
+
alita_client: Any = None
|
|
39
|
+
|
|
40
|
+
def __init__(self, client, **kwargs):
|
|
41
|
+
super().__init__(**kwargs)
|
|
42
|
+
self.alita_client = client
|
|
43
|
+
|
|
44
|
+
def _run(self, prompt: str, n: int = 1, size: str = "auto",
|
|
45
|
+
quality: str = "auto", style: Optional[str] = None) -> list:
|
|
46
|
+
"""Generate an image based on the provided parameters."""
|
|
47
|
+
try:
|
|
48
|
+
logger.info(f"Generating image with prompt: {prompt[:50]}...")
|
|
49
|
+
|
|
50
|
+
result = self.alita_client.generate_image(
|
|
51
|
+
prompt=prompt,
|
|
52
|
+
n=n,
|
|
53
|
+
size=size,
|
|
54
|
+
quality=quality,
|
|
55
|
+
style=style
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Return multimodal content format for LLM consumption
|
|
59
|
+
if 'data' in result:
|
|
60
|
+
images = result['data']
|
|
61
|
+
content_chunks = []
|
|
62
|
+
|
|
63
|
+
# Add a text description of what was generated
|
|
64
|
+
if len(images) == 1:
|
|
65
|
+
content_chunks.append({
|
|
66
|
+
"type": "text",
|
|
67
|
+
"text": f"Generated image for prompt: '{prompt}'"
|
|
68
|
+
})
|
|
69
|
+
else:
|
|
70
|
+
content_chunks.append({
|
|
71
|
+
"type": "text",
|
|
72
|
+
"text": f"Generated {len(images)} images for prompt: '{prompt}'"
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
# Add image content for each generated image
|
|
76
|
+
for image_data in images:
|
|
77
|
+
if image_data.get('url'):
|
|
78
|
+
content_chunks.append({
|
|
79
|
+
"type": "image_url",
|
|
80
|
+
"image_url": {
|
|
81
|
+
"url": image_data['url']
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
elif image_data.get('b64_json'):
|
|
85
|
+
content_chunks.append({
|
|
86
|
+
"type": "image_url",
|
|
87
|
+
"image_url": {
|
|
88
|
+
"url": f"data:image/png;base64,{image_data['b64_json']}"
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
return content_chunks
|
|
93
|
+
|
|
94
|
+
# Fallback to text response if no images in result
|
|
95
|
+
return [{
|
|
96
|
+
"type": "text",
|
|
97
|
+
"text": f"Image generation completed but no images returned: {result}"
|
|
98
|
+
}]
|
|
99
|
+
|
|
100
|
+
except Exception as e:
|
|
101
|
+
logger.error(f"Error generating image: {e}")
|
|
102
|
+
return [{
|
|
103
|
+
"type": "text",
|
|
104
|
+
"text": f"Error generating image: {str(e)}"
|
|
105
|
+
}]
|
|
106
|
+
|
|
107
|
+
async def _arun(self, prompt: str, n: int = 1, size: str = "256x256",
|
|
108
|
+
quality: str = "auto",
|
|
109
|
+
style: Optional[str] = None) -> list:
|
|
110
|
+
"""Async version - for now just calls the sync version."""
|
|
111
|
+
return self._run(prompt, n, size, quality, style)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def create_image_generation_tool(client):
|
|
115
|
+
"""Create an image generation tool with the provided Alita client."""
|
|
116
|
+
return ImageGenerationTool(client=client)
|
alita_sdk/runtime/tools/llm.py
CHANGED
|
@@ -87,7 +87,8 @@ class LLMNode(BaseTool):
|
|
|
87
87
|
if not func_args.get('system') or not func_args.get('task'):
|
|
88
88
|
raise ToolException(f"LLMNode requires 'system' and 'task' parameters in input mapping. "
|
|
89
89
|
f"Actual params: {func_args}")
|
|
90
|
-
|
|
90
|
+
# cast to str in case user passes variable different from str
|
|
91
|
+
messages = [SystemMessage(content=str(func_args.get('system'))), HumanMessage(content=str(func_args.get('task')))]
|
|
91
92
|
messages.extend(func_args.get('chat_history', []))
|
|
92
93
|
else:
|
|
93
94
|
# Flow for chat-based LLM node w/o prompt/task from pipeline but with messages in state
|
|
@@ -178,12 +179,25 @@ class LLMNode(BaseTool):
|
|
|
178
179
|
logger.info(f"Executing tool '{tool_name}' with args: {tool_args}")
|
|
179
180
|
tool_result = tool_to_execute.invoke(tool_args)
|
|
180
181
|
|
|
181
|
-
# Create tool message with result
|
|
182
|
+
# Create tool message with result - preserve structured content
|
|
182
183
|
from langchain_core.messages import ToolMessage
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
)
|
|
184
|
+
|
|
185
|
+
# Check if tool_result is structured content (list of dicts)
|
|
186
|
+
# TODO: need solid check for being compatible with ToolMessage content format
|
|
187
|
+
if isinstance(tool_result, list) and all(
|
|
188
|
+
isinstance(item, dict) and 'type' in item for item in tool_result
|
|
189
|
+
):
|
|
190
|
+
# Use structured content directly for multimodal support
|
|
191
|
+
tool_message = ToolMessage(
|
|
192
|
+
content=tool_result,
|
|
193
|
+
tool_call_id=tool_call_id
|
|
194
|
+
)
|
|
195
|
+
else:
|
|
196
|
+
# Fallback to string conversion for other tool results
|
|
197
|
+
tool_message = ToolMessage(
|
|
198
|
+
content=str(tool_result),
|
|
199
|
+
tool_call_id=tool_call_id
|
|
200
|
+
)
|
|
187
201
|
new_messages.append(tool_message)
|
|
188
202
|
|
|
189
203
|
except Exception as e:
|
|
@@ -17,8 +17,10 @@ def get_tools(tool):
|
|
|
17
17
|
toolkit = QtestToolkit.get_toolkit(
|
|
18
18
|
selected_tools=tool['settings'].get('selected_tools', []),
|
|
19
19
|
qtest_project_id=tool['settings'].get('qtest_project_id', tool['settings'].get('project_id', None)),
|
|
20
|
+
no_of_tests_shown_in_dql_search=tool['settings'].get('no_of_tests_shown_in_dql_search'),
|
|
20
21
|
qtest_configuration=tool['settings']['qtest_configuration'],
|
|
21
|
-
toolkit_name=tool.get('toolkit_name')
|
|
22
|
+
toolkit_name=tool.get('toolkit_name'),
|
|
23
|
+
llm=tool['settings'].get('llm', None)
|
|
22
24
|
)
|
|
23
25
|
return toolkit.tools
|
|
24
26
|
|
|
@@ -37,7 +39,10 @@ class QtestToolkit(BaseToolkit):
|
|
|
37
39
|
'configuration_types': ['qtest']})),
|
|
38
40
|
qtest_project_id=(int, Field(default=None, description="QTest project id", json_schema_extra={'toolkit_name': True,
|
|
39
41
|
'max_toolkit_length': QtestToolkit.toolkit_max_length})),
|
|
40
|
-
|
|
42
|
+
no_of_tests_shown_in_dql_search=(Optional[int], Field(description="Max number of items returned by dql search",
|
|
43
|
+
default=10)),
|
|
44
|
+
|
|
45
|
+
selected_tools=(List[Literal[tuple(selected_tools)]],
|
|
41
46
|
Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
42
47
|
__config__=ConfigDict(json_schema_extra={'metadata': {"label": "QTest", "icon_url": "qtest.svg",
|
|
43
48
|
"categories": ["test management"],
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import base64
|
|
1
2
|
import json
|
|
2
3
|
import logging
|
|
4
|
+
import re
|
|
3
5
|
from traceback import format_exc
|
|
4
6
|
from typing import Any, Optional
|
|
5
7
|
|
|
@@ -11,6 +13,7 @@ from swagger_client import TestCaseApi, SearchApi, PropertyResource, ModuleApi
|
|
|
11
13
|
from swagger_client.rest import ApiException
|
|
12
14
|
|
|
13
15
|
from ..elitea_base import BaseToolApiWrapper
|
|
16
|
+
from ..utils.content_parser import parse_file_content
|
|
14
17
|
|
|
15
18
|
QTEST_ID = "QTest Id"
|
|
16
19
|
|
|
@@ -64,7 +67,10 @@ logger = logging.getLogger(__name__)
|
|
|
64
67
|
|
|
65
68
|
QtestDataQuerySearch = create_model(
|
|
66
69
|
"QtestDataQuerySearch",
|
|
67
|
-
dql=(str, Field(description="Qtest Data Query Language (DQL) query string"))
|
|
70
|
+
dql=(str, Field(description="Qtest Data Query Language (DQL) query string")),
|
|
71
|
+
extract_images=(Optional[bool], Field(description="Should images be processed by llm", default=False)),
|
|
72
|
+
prompt=(Optional[str], Field(description="Prompt for image processing", default=None))
|
|
73
|
+
)
|
|
68
74
|
|
|
69
75
|
QtestCreateTestCase = create_model(
|
|
70
76
|
"QtestCreateTestCase",
|
|
@@ -92,6 +98,8 @@ UpdateTestCase = create_model(
|
|
|
92
98
|
FindTestCaseById = create_model(
|
|
93
99
|
"FindTestCaseById",
|
|
94
100
|
test_id=(str, Field(description="Test case ID e.g. TC-1234")),
|
|
101
|
+
extract_images=(Optional[bool], Field(description="Should images be processed by llm", default=False)),
|
|
102
|
+
prompt=(Optional[str], Field(description="Prompt for image processing", default=None))
|
|
95
103
|
)
|
|
96
104
|
|
|
97
105
|
DeleteTestCase = create_model(
|
|
@@ -118,6 +126,7 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
118
126
|
page: int = 1
|
|
119
127
|
no_of_tests_shown_in_dql_search: int = 10
|
|
120
128
|
_client: Any = PrivateAttr()
|
|
129
|
+
llm: Any
|
|
121
130
|
|
|
122
131
|
@model_validator(mode='before')
|
|
123
132
|
@classmethod
|
|
@@ -234,7 +243,7 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
234
243
|
raise ToolException(
|
|
235
244
|
f"Unable to create test case in project - {self.qtest_project_id} with the following content:\n{test_case_content}.\n\n Stacktrace was {stacktrace}") from e
|
|
236
245
|
|
|
237
|
-
def __parse_data(self, response_to_parse: dict, parsed_data: list):
|
|
246
|
+
def __parse_data(self, response_to_parse: dict, parsed_data: list, extract_images: bool=False, prompt: str=None):
|
|
238
247
|
import html
|
|
239
248
|
for item in response_to_parse['items']:
|
|
240
249
|
parsed_data_row = {
|
|
@@ -245,8 +254,8 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
245
254
|
QTEST_ID: item['id'],
|
|
246
255
|
'Steps': list(map(lambda step: {
|
|
247
256
|
'Test Step Number': step[0] + 1,
|
|
248
|
-
'Test Step Description': step[1]['description'],
|
|
249
|
-
'Test Step Expected Result':
|
|
257
|
+
'Test Step Description': self._process_image(step[1]['description'], extract_images, prompt),
|
|
258
|
+
'Test Step Expected Result': self._process_image(step[1]['expected'], extract_images, prompt)
|
|
250
259
|
}, enumerate(item['test_steps']))),
|
|
251
260
|
'Status': ''.join([properties['field_value_name'] for properties in item['properties']
|
|
252
261
|
if properties['field_name'] == 'Status']),
|
|
@@ -259,7 +268,27 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
259
268
|
}
|
|
260
269
|
parsed_data.append(parsed_data_row)
|
|
261
270
|
|
|
262
|
-
def
|
|
271
|
+
def _process_image(self, content: str, extract: bool=False, prompt: str=None):
|
|
272
|
+
#extract image by regex
|
|
273
|
+
img_regex = r'<img\s+src="data:image\/[^;]+;base64,([^"]+)"\s+[^>]*data-filename="([^"]+)"[^>]*>'
|
|
274
|
+
|
|
275
|
+
def replace_image(match):
|
|
276
|
+
base64_content = match.group(1)
|
|
277
|
+
file_name = match.group(2)
|
|
278
|
+
|
|
279
|
+
file_content = base64.b64decode(base64_content)
|
|
280
|
+
|
|
281
|
+
if extract:
|
|
282
|
+
description = f"<img description=\"{parse_file_content(file_content=file_content, file_name=file_name, prompt=prompt, llm=self.llm)}\">"
|
|
283
|
+
else:
|
|
284
|
+
description = ""
|
|
285
|
+
|
|
286
|
+
return description
|
|
287
|
+
#replace image tag by description
|
|
288
|
+
content = re.sub(img_regex, replace_image, content)
|
|
289
|
+
return content
|
|
290
|
+
|
|
291
|
+
def __perform_search_by_dql(self, dql: str, extract_images:bool=False, prompt: str=None) -> list:
|
|
263
292
|
search_instance: SearchApi = swagger_client.SearchApi(self._client)
|
|
264
293
|
body = swagger_client.ArtifactSearchParams(object_type='test-cases', fields=['*'],
|
|
265
294
|
query=dql)
|
|
@@ -270,7 +299,7 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
270
299
|
api_response = search_instance.search_artifact(self.qtest_project_id, body, append_test_steps=append_test_steps,
|
|
271
300
|
include_external_properties=include_external_properties,
|
|
272
301
|
page_size=self.no_of_items_per_page, page=self.page)
|
|
273
|
-
self.__parse_data(api_response, parsed_data)
|
|
302
|
+
self.__parse_data(api_response, parsed_data, extract_images, prompt)
|
|
274
303
|
|
|
275
304
|
if api_response['links']:
|
|
276
305
|
while api_response['links'][0]['rel'] == 'next':
|
|
@@ -279,7 +308,7 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
279
308
|
append_test_steps=append_test_steps,
|
|
280
309
|
include_external_properties=include_external_properties,
|
|
281
310
|
page_size=self.no_of_items_per_page, page=next_page)
|
|
282
|
-
self.__parse_data(api_response, parsed_data)
|
|
311
|
+
self.__parse_data(api_response, parsed_data, extract_images, prompt)
|
|
283
312
|
except ApiException as e:
|
|
284
313
|
stacktrace = format_exc()
|
|
285
314
|
logger.error(f"Exception when calling SearchApi->search_artifact: \n {stacktrace}")
|
|
@@ -347,9 +376,9 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
347
376
|
logger.error(f"Error: {format_exc()}")
|
|
348
377
|
raise e
|
|
349
378
|
|
|
350
|
-
def search_by_dql(self, dql: str):
|
|
379
|
+
def search_by_dql(self, dql: str, extract_images:bool=False, prompt: str=None):
|
|
351
380
|
"""Search for the test cases in qTest using Data Query Language """
|
|
352
|
-
parsed_data = self.__perform_search_by_dql(dql)
|
|
381
|
+
parsed_data = self.__perform_search_by_dql(dql, extract_images, prompt)
|
|
353
382
|
return "Found " + str(
|
|
354
383
|
len(parsed_data)) + f" Qtest test cases:\n" + str(parsed_data[:self.no_of_tests_shown_in_dql_search])
|
|
355
384
|
|
|
@@ -398,10 +427,10 @@ class QtestApiWrapper(BaseToolApiWrapper):
|
|
|
398
427
|
raise ToolException(
|
|
399
428
|
f"""Unable to update test case in project with id - {self.qtest_project_id} and test id - {test_id}.\n Exception: \n {stacktrace}""") from e
|
|
400
429
|
|
|
401
|
-
def find_test_case_by_id(self, test_id: str) -> str:
|
|
430
|
+
def find_test_case_by_id(self, test_id: str, extract_images=False, prompt=None) -> str:
|
|
402
431
|
""" Find the test case by its id. Id should be in format TC-123. """
|
|
403
432
|
dql: str = f"Id = '{test_id}'"
|
|
404
|
-
return f"{self.search_by_dql(dql=dql)}"
|
|
433
|
+
return f"{self.search_by_dql(dql=dql, extract_images=extract_images, prompt=prompt)}"
|
|
405
434
|
|
|
406
435
|
def delete_test_case(self, qtest_id: int) -> str:
|
|
407
436
|
""" Delete the test case by its id. Id should be in format 3534653120. """
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.359
|
|
4
4
|
Summary: SDK for building langchain agents using resources from Alita
|
|
5
5
|
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedj27@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -36,11 +36,11 @@ alita_sdk/configurations/zephyr_essential.py,sha256=tUIrh-PRNvdrLBj6rJXqlF-h6oaM
|
|
|
36
36
|
alita_sdk/runtime/__init__.py,sha256=4W0UF-nl3QF2bvET5lnah4o24CoTwSoKXhuN0YnwvEE,828
|
|
37
37
|
alita_sdk/runtime/clients/__init__.py,sha256=BdehU5GBztN1Qi1Wul0cqlU46FxUfMnI6Vq2Zd_oq1M,296
|
|
38
38
|
alita_sdk/runtime/clients/artifact.py,sha256=Tt3aWcxu20bVW6EX7s_iX5CTmcItKhUnkk8Q2gv2vw0,4036
|
|
39
|
-
alita_sdk/runtime/clients/client.py,sha256=
|
|
39
|
+
alita_sdk/runtime/clients/client.py,sha256=sNa_2Ep1ugfuMQS27LxkPnw05EChpNOW3MdsdhL8bSA,45421
|
|
40
40
|
alita_sdk/runtime/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
|
|
41
41
|
alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
|
|
42
42
|
alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
-
alita_sdk/runtime/langchain/assistant.py,sha256=
|
|
43
|
+
alita_sdk/runtime/langchain/assistant.py,sha256=2tH8je9uKegIIIZUuiGU4zqRVg7jyQas8ftkwx01qWw,15224
|
|
44
44
|
alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
|
|
45
45
|
alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
|
|
46
46
|
alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
|
|
@@ -103,7 +103,7 @@ alita_sdk/runtime/toolkits/prompt.py,sha256=WIpTkkVYWqIqOWR_LlSWz3ug8uO9tm5jJ7aZ
|
|
|
103
103
|
alita_sdk/runtime/toolkits/subgraph.py,sha256=wwUK8JjPXkGzyVZ3tAukmvST6eGbqx_U11rpnmbrvtg,2105
|
|
104
104
|
alita_sdk/runtime/toolkits/tools.py,sha256=YkDvbN1TdWNO-wHbbJbNeonGCwCPlxsuegH33mCfE-I,8303
|
|
105
105
|
alita_sdk/runtime/toolkits/vectorstore.py,sha256=BGppQADa1ZiLO17fC0uCACTTEvPHlodEDYEzUcBRbAA,2901
|
|
106
|
-
alita_sdk/runtime/tools/__init__.py,sha256=
|
|
106
|
+
alita_sdk/runtime/tools/__init__.py,sha256=TbHPnDtCdQvNzK1YQnk_ufkuI7FgHfvY1-JWUgycZhQ,497
|
|
107
107
|
alita_sdk/runtime/tools/agent.py,sha256=m98QxOHwnCRTT9j18Olbb5UPS8-ZGeQaGiUyZJSyFck,3162
|
|
108
108
|
alita_sdk/runtime/tools/application.py,sha256=z3vLZODs-_xEEnZFmGF0fKz1j3VtNJxqsAmg5ovExpQ,3129
|
|
109
109
|
alita_sdk/runtime/tools/artifact.py,sha256=wh2e9JSVBZzJHhNOANhHFF6BaK0RtuZ3kvhkqTrTbys,12234
|
|
@@ -111,8 +111,9 @@ alita_sdk/runtime/tools/datasource.py,sha256=pvbaSfI-ThQQnjHG-QhYNSTYRnZB0rYtZFp
|
|
|
111
111
|
alita_sdk/runtime/tools/echo.py,sha256=spw9eCweXzixJqHnZofHE1yWiSUa04L4VKycf3KCEaM,486
|
|
112
112
|
alita_sdk/runtime/tools/function.py,sha256=0iZJ-UxaPbtcXAVX9G5Vsn7vmD7lrz3cBG1qylto1gs,2844
|
|
113
113
|
alita_sdk/runtime/tools/graph.py,sha256=MbnZYqdmvZY7SGDp43lOVVIjUt5ARHSgj43mdtBjSjQ,3092
|
|
114
|
+
alita_sdk/runtime/tools/image_generation.py,sha256=8ZH4SoRrbS4EzmtF6cpNMRvuFephCYD2S8uqNC9KGE4,4274
|
|
114
115
|
alita_sdk/runtime/tools/indexer_tool.py,sha256=whSLPevB4WD6dhh2JDXEivDmTvbjiMV1MrPl9cz5eLA,4375
|
|
115
|
-
alita_sdk/runtime/tools/llm.py,sha256=
|
|
116
|
+
alita_sdk/runtime/tools/llm.py,sha256=YDb0kIu3QCiv2DkgpnFv5-pbAor6CMQ5IcYnyVMQrtY,15142
|
|
116
117
|
alita_sdk/runtime/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
|
|
117
118
|
alita_sdk/runtime/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
|
|
118
119
|
alita_sdk/runtime/tools/mcp_server_tool.py,sha256=MhLxZJ44LYrB_0GrojmkyqKoDRaqIHkEQAsg718ipog,4277
|
|
@@ -300,8 +301,8 @@ alita_sdk/tools/postman/api_wrapper.py,sha256=TY8ddkrFWTsMWK9Dd0cTXNCmihhfbxFw8E
|
|
|
300
301
|
alita_sdk/tools/postman/postman_analysis.py,sha256=2d-Oi2UORosIePIUyncSONw9hY7dw8Zc7BQvCd4aqpg,45115
|
|
301
302
|
alita_sdk/tools/pptx/__init__.py,sha256=vVUrWnj7KWJgEk9oxGSsCAQ2SMSXrp_SFOdUHYQKcAo,3444
|
|
302
303
|
alita_sdk/tools/pptx/pptx_wrapper.py,sha256=yyCYcTlIY976kJ4VfPo4dyxj4yeii9j9TWP6W8ZIpN8,29195
|
|
303
|
-
alita_sdk/tools/qtest/__init__.py,sha256=
|
|
304
|
-
alita_sdk/tools/qtest/api_wrapper.py,sha256=
|
|
304
|
+
alita_sdk/tools/qtest/__init__.py,sha256=Jf0xo5S_4clXR2TfCbJbB1sFgCbcFQRM-YYX2ltWBzo,4461
|
|
305
|
+
alita_sdk/tools/qtest/api_wrapper.py,sha256=jQSnmYUXyqZyRImzOaxJ7TjrvPwxUw-AWJk3UErwHcw,25597
|
|
305
306
|
alita_sdk/tools/qtest/tool.py,sha256=kKzNPS4fUC76WQQttQ6kdVANViHEvKE8Kf174MQiNYU,562
|
|
306
307
|
alita_sdk/tools/rally/__init__.py,sha256=2BPPXJxAOKgfmaxVFVvxndfK0JxOXDLkoRmzu2dUwOE,3512
|
|
307
308
|
alita_sdk/tools/rally/api_wrapper.py,sha256=mouzU6g0KML4UNapdk0k6Q0pU3MpJuWnNo71n9PSEHM,11752
|
|
@@ -351,8 +352,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
|
|
|
351
352
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
|
|
352
353
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
|
353
354
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
|
354
|
-
alita_sdk-0.3.
|
|
355
|
-
alita_sdk-0.3.
|
|
356
|
-
alita_sdk-0.3.
|
|
357
|
-
alita_sdk-0.3.
|
|
358
|
-
alita_sdk-0.3.
|
|
355
|
+
alita_sdk-0.3.359.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
356
|
+
alita_sdk-0.3.359.dist-info/METADATA,sha256=dG_WTlIsQxUJe23SVu_qFSJZM_5VXyW-xfG7UrcTSEE,19071
|
|
357
|
+
alita_sdk-0.3.359.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
358
|
+
alita_sdk-0.3.359.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
359
|
+
alita_sdk-0.3.359.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|