codemie-test-harness 0.1.183__py3-none-any.whl → 0.1.197__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 codemie-test-harness might be problematic. Click here for more details.
- codemie_test_harness/cli/cli.py +21 -6
- codemie_test_harness/cli/commands/run_cmd.py +15 -1
- codemie_test_harness/cli/constants.py +1 -21
- codemie_test_harness/cli/runner.py +13 -3
- codemie_test_harness/cli/utils.py +12 -2
- codemie_test_harness/tests/assistant/test_assistants.py +17 -1
- codemie_test_harness/tests/assistant/tools/codebase/test_codebase_tools.py +1 -1
- codemie_test_harness/tests/assistant/tools/datamanagement/test_assistant_with_data_management_tools.py +47 -6
- codemie_test_harness/tests/assistant/tools/mcp/test_cli_mcp_server.py +0 -4
- codemie_test_harness/tests/assistant/tools/mcp/test_mcp_servers.py +0 -4
- codemie_test_harness/tests/conftest.py +2 -2
- codemie_test_harness/tests/enums/environment.py +3 -3
- codemie_test_harness/tests/enums/integrations.py +1 -0
- codemie_test_harness/tests/enums/model_types.py +1 -0
- codemie_test_harness/tests/integrations/project/test_default_integrations.py +41 -15
- codemie_test_harness/tests/integrations/project/test_project_integrations.py +42 -0
- codemie_test_harness/tests/integrations/user/test_default_integrations.py +0 -7
- codemie_test_harness/tests/llm/assistants/test_llm.py +56 -2
- codemie_test_harness/tests/test_data/assistant_test_data.py +448 -448
- codemie_test_harness/tests/test_data/codebase_tools_test_data.py +2 -0
- codemie_test_harness/tests/test_data/data_management_tools_test_data.py +18 -0
- codemie_test_harness/tests/test_data/direct_tools/data_management_tools_test_data.py +18 -1
- codemie_test_harness/tests/test_data/direct_tools/report_portal_tools_test_data.py +189 -197
- codemie_test_harness/tests/test_data/integrations_test_data.py +163 -2
- codemie_test_harness/tests/test_data/llm_test_data.py +1 -0
- codemie_test_harness/tests/test_data/open_api_tools_test_data.py +22 -1
- codemie_test_harness/tests/test_data/report_portal_tools_test_data.py +89 -112
- codemie_test_harness/tests/test_data/research_tools_test_data.py +29 -7
- codemie_test_harness/tests/utils/assistant_utils.py +22 -12
- codemie_test_harness/tests/utils/credentials_manager.py +66 -8
- codemie_test_harness/tests/utils/workflow_utils.py +91 -0
- codemie_test_harness/tests/workflow/assistant_tools/access_management/test_workflow_with_assistant_with_keycloak_tool.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_test_plan_tools.py +50 -1
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_wiki_tools.py +39 -1
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_work_item_tools.py +34 -1
- codemie_test_harness/tests/workflow/assistant_tools/cloud/test_workflow_with_assistant_cloud_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/codebase/test_worfklow_with_assistant_codebase_tools.py +11 -0
- codemie_test_harness/tests/workflow/assistant_tools/data_management/test_workflow_with_assistant_with_data_management_tools.py +72 -1
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool.py +31 -0
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +31 -0
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +26 -0
- codemie_test_harness/tests/workflow/assistant_tools/file_management/test_workflow_with_assistant_with_file_management_tools.py +63 -1
- codemie_test_harness/tests/workflow/assistant_tools/git/test_workflow_with_assistant_git_tools.py +82 -7
- codemie_test_harness/tests/workflow/assistant_tools/mcp/test_workflow_with_assistant_with_mcp_server.py +23 -4
- codemie_test_harness/tests/workflow/assistant_tools/notification/test_workflow_with_assistant_notification_tools.py +12 -0
- codemie_test_harness/tests/workflow/assistant_tools/open_api/test_workflow_with_assistant_with_open_api_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_development_plugin.py +29 -2
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_plugin_and_mcp_servers.py +14 -1
- codemie_test_harness/tests/workflow/assistant_tools/project_management/test_workflow_with_assistant_pm_tools.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/report_portal/test_workflow_with_assistant_with_report_portal_tools.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/research/test_workflow_with_assistant_research_tools.py +14 -1
- codemie_test_harness/tests/workflow/assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/vcs/workflow_with_assistant_vcs_tools.py +6 -0
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_cloud_tools.py +12 -9
- codemie_test_harness/tests/workflow/virtual_assistant_tools/access_management/test_workflow_with_keycloak_tool.py +8 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_test_plan_tools.py +28 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_wiki_tools.py +24 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_work_item_tools.py +20 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/cloud/test_workflow_with_cloud_tools.py +13 -4
- codemie_test_harness/tests/workflow/virtual_assistant_tools/codebase/test_workflow_with_codebase_tools.py +16 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/data_management/test_workflow_with_data_management_tools.py +73 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/file_management/test_workflow_with_file_management_tools.py +101 -49
- codemie_test_harness/tests/workflow/virtual_assistant_tools/git/test_workflow_with_git_tools.py +42 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py +27 -5
- codemie_test_harness/tests/workflow/virtual_assistant_tools/notification/test_workflow_with_notification_tools.py +13 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/open_api/test_workflow_with_open_api_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_development_plugin.py +20 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_plugin_and_mcp_servers.py +14 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/project_management/test_workflow_with_project_management_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/test_workflow_with_report_portal_tool.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/research/test_workflow_with_research_tools.py +9 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py +9 -1
- {codemie_test_harness-0.1.183.dist-info → codemie_test_harness-0.1.197.dist-info}/METADATA +38 -3
- {codemie_test_harness-0.1.183.dist-info → codemie_test_harness-0.1.197.dist-info}/RECORD +80 -80
- {codemie_test_harness-0.1.183.dist-info → codemie_test_harness-0.1.197.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.183.dist-info → codemie_test_harness-0.1.197.dist-info}/entry_points.txt +0 -0
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
-
from codemie_sdk.models.integration import CredentialTypes
|
|
3
|
+
from codemie_sdk.models.integration import CredentialTypes, CredentialValues
|
|
4
4
|
from codemie_test_harness.tests.enums.integrations import DataBaseDialect
|
|
5
|
+
from codemie_test_harness.tests.enums.tools import (
|
|
6
|
+
Toolkit,
|
|
7
|
+
VcsTool,
|
|
8
|
+
NotificationTool,
|
|
9
|
+
ProjectManagementTool,
|
|
10
|
+
ServiceNowTool,
|
|
11
|
+
OpenApiTool,
|
|
12
|
+
)
|
|
13
|
+
from codemie_test_harness.tests.test_data.notification_tools_test_data import (
|
|
14
|
+
EMAIL_TOOL_PROMPT,
|
|
15
|
+
TELEGRAM_TOOL_PROMPT,
|
|
16
|
+
)
|
|
17
|
+
from codemie_test_harness.tests.test_data.open_api_tools_test_data import (
|
|
18
|
+
OPEN_API_SPEC_TOOL_TASK,
|
|
19
|
+
)
|
|
20
|
+
from codemie_test_harness.tests.test_data.pm_tools_test_data import (
|
|
21
|
+
JIRA_TOOL_PROMPT,
|
|
22
|
+
CONFLUENCE_TOOL_PROMPT,
|
|
23
|
+
)
|
|
24
|
+
from codemie_test_harness.tests.test_data.servicenow_tools_test_data import PROMPT
|
|
5
25
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
6
26
|
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
7
27
|
|
|
@@ -362,7 +382,7 @@ invalid_integrations = [
|
|
|
362
382
|
pytest.param(
|
|
363
383
|
CredentialTypes.EMAIL,
|
|
364
384
|
CredentialsManager.invalid_gmail_credentials(),
|
|
365
|
-
"SMTP Code: 535.
|
|
385
|
+
"SMTP Code: 535, Message: 5.7.8 Username and Password not accepted.",
|
|
366
386
|
marks=[
|
|
367
387
|
pytest.mark.email,
|
|
368
388
|
pytest.mark.notification,
|
|
@@ -412,3 +432,144 @@ invalid_integrations = [
|
|
|
412
432
|
id=CredentialTypes.REPORT_PORTAL,
|
|
413
433
|
),
|
|
414
434
|
]
|
|
435
|
+
|
|
436
|
+
empty_credentials_integrations = [
|
|
437
|
+
pytest.param(
|
|
438
|
+
[
|
|
439
|
+
CredentialValues(key="url", value="https://gitlab.com"),
|
|
440
|
+
],
|
|
441
|
+
CredentialTypes.GIT,
|
|
442
|
+
Toolkit.VCS,
|
|
443
|
+
VcsTool.GITLAB,
|
|
444
|
+
f"Using gitlab tool get info about MR №7014 for repo with id '{CredentialsManager.get_parameter('GITLAB_PROJECT_ID')}'",
|
|
445
|
+
"""
|
|
446
|
+
It seems there is an issue with the GitLab configuration, as it hasn't been set up properly for this tool.
|
|
447
|
+
This requires setting up authentication and configuration to connect to a GitLab instance.
|
|
448
|
+
|
|
449
|
+
Could you please check your GitLab tool configuration and provide the necessary access details so that I can assist you further?
|
|
450
|
+
""",
|
|
451
|
+
marks=[pytest.mark.gitlab],
|
|
452
|
+
id=f"{CredentialTypes.GIT}_gitlab_empty",
|
|
453
|
+
),
|
|
454
|
+
pytest.param(
|
|
455
|
+
[
|
|
456
|
+
CredentialValues(key="url", value="https://github.com"),
|
|
457
|
+
],
|
|
458
|
+
CredentialTypes.GIT,
|
|
459
|
+
Toolkit.VCS,
|
|
460
|
+
VcsTool.GITHUB,
|
|
461
|
+
f"Using github tool get info about issue №5 for the repo {CredentialsManager.get_parameter('GITHUB_PROJECT')}.",
|
|
462
|
+
"""
|
|
463
|
+
It seems there is an issue with accessing the GitHub API due to a missing configuration.
|
|
464
|
+
Unfortunately, I can't fetch the information directly at the moment.
|
|
465
|
+
However, you can access information about an issue using the following steps on your own:
|
|
466
|
+
|
|
467
|
+
1. Navigate to the Issues tab of the repository [wild47/final_task](https://github.com/wild47/final_task).
|
|
468
|
+
2. Look for issue number 5 or directly visit `https://github.com/wild47/final_task/issues/5`,
|
|
469
|
+
and it should display all the details regarding that specific issue.
|
|
470
|
+
|
|
471
|
+
If there's anything else you'd like assistance with, please let me know!
|
|
472
|
+
""",
|
|
473
|
+
marks=[pytest.mark.github],
|
|
474
|
+
id=f"{CredentialTypes.GIT}_github_empty",
|
|
475
|
+
),
|
|
476
|
+
pytest.param(
|
|
477
|
+
[
|
|
478
|
+
CredentialValues(key="url", value=CredentialsManager.AUTO_GENERATED),
|
|
479
|
+
],
|
|
480
|
+
CredentialTypes.EMAIL,
|
|
481
|
+
Toolkit.NOTIFICATION,
|
|
482
|
+
NotificationTool.EMAIL,
|
|
483
|
+
EMAIL_TOOL_PROMPT,
|
|
484
|
+
"""
|
|
485
|
+
It looks like there's an issue with the SMTP configuration; it's missing a valid SMTP URL to send the email.
|
|
486
|
+
Please ensure that the SMTP settings are properly configured in the system.
|
|
487
|
+
If you have access to the SMTP details, such as the server URL, username, and password, you could input them into the system to resolve this issue.
|
|
488
|
+
""",
|
|
489
|
+
marks=[pytest.mark.email, pytest.mark.notification],
|
|
490
|
+
id=f"{CredentialTypes.EMAIL}_empty",
|
|
491
|
+
),
|
|
492
|
+
pytest.param(
|
|
493
|
+
[
|
|
494
|
+
CredentialValues(key="url", value=CredentialsManager.AUTO_GENERATED),
|
|
495
|
+
],
|
|
496
|
+
CredentialTypes.TELEGRAM,
|
|
497
|
+
Toolkit.NOTIFICATION,
|
|
498
|
+
NotificationTool.TELEGRAM,
|
|
499
|
+
TELEGRAM_TOOL_PROMPT,
|
|
500
|
+
"""
|
|
501
|
+
It seems I don't have access to the necessary Telegram bot token to send a message.
|
|
502
|
+
|
|
503
|
+
You should verify that the bot token is set up correctly or send the message directly through your Telegram bot using your bot's token.
|
|
504
|
+
|
|
505
|
+
If you have your bot token and need help with the API request, let me know!
|
|
506
|
+
""",
|
|
507
|
+
marks=[pytest.mark.telegram, pytest.mark.notification],
|
|
508
|
+
id=f"{CredentialTypes.TELEGRAM}_empty",
|
|
509
|
+
),
|
|
510
|
+
pytest.param(
|
|
511
|
+
[
|
|
512
|
+
CredentialValues(
|
|
513
|
+
key="url", value=CredentialsManager.get_parameter("JIRA_URL")
|
|
514
|
+
)
|
|
515
|
+
],
|
|
516
|
+
CredentialTypes.JIRA,
|
|
517
|
+
Toolkit.PROJECT_MANAGEMENT,
|
|
518
|
+
ProjectManagementTool.JIRA,
|
|
519
|
+
JIRA_TOOL_PROMPT,
|
|
520
|
+
"""
|
|
521
|
+
It seems that there's an authorization issue when trying to access the JIRA ticket.
|
|
522
|
+
The error indicates that the request is unauthorized.
|
|
523
|
+
You may need to ensure that the correct credentials are being used, or check if you have the necessary permissions to access the ticket.
|
|
524
|
+
|
|
525
|
+
If there's anything else you'd like to try or if you have further details, let me know!
|
|
526
|
+
""",
|
|
527
|
+
marks=[pytest.mark.jira, pytest.mark.project_management],
|
|
528
|
+
id=f"{CredentialTypes.JIRA}_empty",
|
|
529
|
+
),
|
|
530
|
+
pytest.param(
|
|
531
|
+
[],
|
|
532
|
+
CredentialTypes.CONFLUENCE,
|
|
533
|
+
Toolkit.PROJECT_MANAGEMENT,
|
|
534
|
+
ProjectManagementTool.CONFLUENCE,
|
|
535
|
+
CONFLUENCE_TOOL_PROMPT,
|
|
536
|
+
"""
|
|
537
|
+
It looks like I don't have the required Confluence URL and credentials set up to perform the requested action.
|
|
538
|
+
If you have access to Confluence, please provide these details or try to access the page directly through your Confluence account.
|
|
539
|
+
""",
|
|
540
|
+
marks=[pytest.mark.confluence, pytest.mark.project_management],
|
|
541
|
+
id=f"{CredentialTypes.CONFLUENCE}_empty",
|
|
542
|
+
),
|
|
543
|
+
pytest.param(
|
|
544
|
+
[
|
|
545
|
+
CredentialValues(key="url", value=""),
|
|
546
|
+
],
|
|
547
|
+
CredentialTypes.SERVICE_NOW,
|
|
548
|
+
Toolkit.SERVICENOW,
|
|
549
|
+
ServiceNowTool.SERVICE_NOW,
|
|
550
|
+
PROMPT,
|
|
551
|
+
"""
|
|
552
|
+
It appears that the ServiceNow configuration is not set, which prevents me from executing the request.
|
|
553
|
+
Please ensure that the ServiceNow configuration, including necessary authentication details,
|
|
554
|
+
is properly set up before using the ServiceNow tool. If you have access to configure these details, please do so and try again.
|
|
555
|
+
""",
|
|
556
|
+
marks=[pytest.mark.servicenow],
|
|
557
|
+
id=f"{CredentialTypes.SERVICE_NOW}_empty",
|
|
558
|
+
),
|
|
559
|
+
pytest.param(
|
|
560
|
+
[
|
|
561
|
+
CredentialValues(key="url", value=CredentialsManager.AUTO_GENERATED),
|
|
562
|
+
],
|
|
563
|
+
CredentialTypes.OPENAPI,
|
|
564
|
+
Toolkit.OPEN_API,
|
|
565
|
+
OpenApiTool.GET_OPEN_API_SPEC,
|
|
566
|
+
OPEN_API_SPEC_TOOL_TASK,
|
|
567
|
+
"""
|
|
568
|
+
It seems that I don't have access to the OpenAPI specification for the `/v1/assistants` endpoint right now.
|
|
569
|
+
To help you better, could you please provide more details about what you'd like to know regarding this endpoint?
|
|
570
|
+
Are you looking for information on request parameters, expected responses, authentication, or something else?
|
|
571
|
+
""",
|
|
572
|
+
marks=[pytest.mark.openapi],
|
|
573
|
+
id=f"{CredentialTypes.OPENAPI}_empty",
|
|
574
|
+
),
|
|
575
|
+
]
|
|
@@ -55,6 +55,7 @@ MODEL_RESPONSES = [
|
|
|
55
55
|
LlmResponseData(ModelTypes.CLAUDE_4_OPUS, AWS_ENVS),
|
|
56
56
|
LlmResponseData(ModelTypes.CLAUDE_4_1_OPUS, AWS_ENVS),
|
|
57
57
|
LlmResponseData(ModelTypes.CLAUDE_4_SONNET_1M, AWS_ENVS),
|
|
58
|
+
LlmResponseData(ModelTypes.CLAUDE_4_5_SONNET, AWS_ENVS),
|
|
58
59
|
# Other LLMs test data
|
|
59
60
|
LlmResponseData(ModelTypes.RLAB_QWQ_32B, OTHER_ENVS),
|
|
60
61
|
LlmResponseData(ModelTypes.DEEPSEEK_R1, OTHER_ENVS),
|
|
@@ -58,6 +58,22 @@ RESPONSE_FOR_OPEN_API_SPEC = """
|
|
|
58
58
|
These endpoints relate to managing assistants, allowing you to list and create assistants in the system.
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
|
+
INVOKE_EXTERNAL_API_TOOL_TASK = (
|
|
62
|
+
"Invoke GET https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.1"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
RESPONSE_EXTERNAL_FOR_INVOKE_API = """
|
|
66
|
+
The response from the Open Meteo API for the latitude 51.5 and longitude -0.1 is as follows:
|
|
67
|
+
|
|
68
|
+
- **Latitude**: 51.5
|
|
69
|
+
- **Longitude**: -0.1
|
|
70
|
+
- **Generation Time (ms)**: 0.0019
|
|
71
|
+
- **UTC Offset (seconds)**: 0
|
|
72
|
+
- **Timezone**: GMT
|
|
73
|
+
- **Timezone Abbreviation**: GMT
|
|
74
|
+
- **Elevation**: 12 meters
|
|
75
|
+
"""
|
|
76
|
+
|
|
61
77
|
open_api_tools_test_data = [
|
|
62
78
|
(
|
|
63
79
|
(OpenApiTool.INVOKE_EXTERNAL_API, OpenApiTool.GET_OPEN_API_SPEC),
|
|
@@ -65,8 +81,13 @@ open_api_tools_test_data = [
|
|
|
65
81
|
RESPONSE_FOR_INVOKE_API,
|
|
66
82
|
),
|
|
67
83
|
(
|
|
68
|
-
OpenApiTool.
|
|
84
|
+
OpenApiTool.GET_OPEN_API_SPEC,
|
|
69
85
|
OPEN_API_SPEC_TOOL_TASK,
|
|
70
86
|
RESPONSE_FOR_OPEN_API_SPEC,
|
|
71
87
|
),
|
|
88
|
+
(
|
|
89
|
+
OpenApiTool.INVOKE_EXTERNAL_API,
|
|
90
|
+
INVOKE_EXTERNAL_API_TOOL_TASK,
|
|
91
|
+
RESPONSE_EXTERNAL_FOR_INVOKE_API,
|
|
92
|
+
),
|
|
72
93
|
]
|
|
@@ -4,7 +4,7 @@ rp_test_data = [
|
|
|
4
4
|
(
|
|
5
5
|
Toolkit.REPORT_PORTAL,
|
|
6
6
|
ReportPortalTool.GET_EXTENDED_LAUNCH_DATA_AS_RAW,
|
|
7
|
-
"Get details for the launch with ID 23 in a raw HTML format",
|
|
7
|
+
"Get details for the launch with ID 23 in a raw HTML format. If content exceeds the token limit for display show truncated version",
|
|
8
8
|
"""
|
|
9
9
|
The launch with ID 23 has been successfully retrieved in HTML format. Here is the raw HTML content for your reference:
|
|
10
10
|
|
|
@@ -90,36 +90,68 @@ rp_test_data = [
|
|
|
90
90
|
(
|
|
91
91
|
Toolkit.REPORT_PORTAL,
|
|
92
92
|
ReportPortalTool.FIND_TEST_ITEM_BY_ID,
|
|
93
|
-
"Get test item by ID
|
|
93
|
+
"Get test item by ID 111487",
|
|
94
94
|
"""
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
95
|
+
Here are the details for the test item with ID **111487**:
|
|
96
|
+
|
|
97
|
+
- **Name**: `codemie_test_harness/tests/assistant/tools/plugin/test_assistant_with_plugin_and_mcp_servers.py::test_assistant_with_plugin_and_cli_mcp_server[ls]`
|
|
98
|
+
- **Code Reference**: `codemie_test_harness/tests/assistant/tools/plugin/test_assistant_with_plugin_and_mcp_servers.py:test_assistant_with_plugin_and_cli_mcp_server`
|
|
99
|
+
|
|
100
|
+
### Parameters
|
|
101
|
+
- **prompt**: `ls`
|
|
102
|
+
- **expected_response**:
|
|
103
|
+
```
|
|
104
|
+
Here is a list of files and directories in `/apps/codemie-sdk/test-harness/codemie_test_harness/tests`:
|
|
105
|
+
|
|
106
|
+
- Files:
|
|
107
|
+
- `.DS_Store`
|
|
108
|
+
- `__init__.py`
|
|
109
|
+
- `conftest.py`
|
|
110
|
+
|
|
111
|
+
- Directories:
|
|
112
|
+
- `__pycache__`
|
|
113
|
+
- `assistant`
|
|
114
|
+
- `e2e`
|
|
115
|
+
- `enums`
|
|
116
|
+
- `integrations`
|
|
117
|
+
- `llm`
|
|
118
|
+
- `providers`
|
|
119
|
+
- `search`
|
|
120
|
+
- `service`
|
|
121
|
+
- `test_data`
|
|
122
|
+
- `ui`
|
|
123
|
+
- `utils`
|
|
124
|
+
- `workflow`
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Attributes
|
|
128
|
+
- **plugin**
|
|
129
|
+
- **assistant**
|
|
130
|
+
- **api**
|
|
131
|
+
- **mcp**
|
|
132
|
+
|
|
133
|
+
### Status
|
|
134
|
+
- **Start Time**: October 8, 2025, 10:02:41 AM UTC
|
|
135
|
+
- **End Time**: October 8, 2025, 10:05:09 AM UTC
|
|
136
|
+
- **Status**: **FAILED**
|
|
137
|
+
|
|
138
|
+
### Execution Statistics
|
|
139
|
+
- **Total Executions**: 1
|
|
140
|
+
- **Failed Executions**: 1
|
|
141
|
+
- **Defects**:
|
|
142
|
+
- **To Investigate**: `ti001` (1 instance)
|
|
143
|
+
|
|
144
|
+
### Issue Details
|
|
145
|
+
- **Issue Type**: `ti001`
|
|
146
|
+
- **Auto Analyzed**: No
|
|
147
|
+
- **Ignore Analyzer**: No
|
|
148
|
+
|
|
149
|
+
### Launch Information
|
|
150
|
+
- **Launch Name**: Pytest Regression
|
|
151
|
+
- **Launch Number**: 121
|
|
152
|
+
- **Launch ID**: 321
|
|
153
|
+
|
|
154
|
+
This test appears to have failed due to a defect marked for investigation. If you need further insights or actions, please let me know!
|
|
123
155
|
""",
|
|
124
156
|
),
|
|
125
157
|
(
|
|
@@ -168,89 +200,34 @@ rp_test_data = [
|
|
|
168
200
|
(
|
|
169
201
|
Toolkit.REPORT_PORTAL,
|
|
170
202
|
ReportPortalTool.GET_LOGS_FOR_TEST_ITEM,
|
|
171
|
-
"Get logs for test item ID
|
|
203
|
+
"Get first page of the logs for test item ID 111487",
|
|
172
204
|
"""
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
7. **Time:** 2025-09-08T08:51:45.228Z
|
|
200
|
-
**Level:** INFO
|
|
201
|
-
**Message:** Successfully processed /v1/assistants request to <class 'dict'>
|
|
202
|
-
|
|
203
|
-
8. **Time:** 2025-09-08T08:51:45.228Z
|
|
204
|
-
**Level:** DEBUG
|
|
205
|
-
**Message:** Making /v1/assistants request to https://codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com/code-assistant-apityping.List[codemie_sdk.models.assistant.AssistantBase]
|
|
206
|
-
|
|
207
|
-
9. **Time:** 2025-09-08T08:51:45.228Z
|
|
208
|
-
**Level:** DEBUG
|
|
209
|
-
**Message:** Request params: {'page': 0, 'per_page': 200, 'scope': 'visible_to_user', 'minimal_response': True}
|
|
210
|
-
|
|
211
|
-
10. **Time:** 2025-09-08T08:51:45.229Z
|
|
212
|
-
**Level:** DEBUG
|
|
213
|
-
**Message:** Starting new HTTPS connection (1): codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com:443
|
|
214
|
-
|
|
215
|
-
11. **Time:** 2025-09-08T08:51:45.299Z
|
|
216
|
-
**Level:** DEBUG
|
|
217
|
-
**Message:** https://codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com:443 "GET /code-assistant-api/v1/assistants?page=0&per_page=200&scope=visible_to_user&minimal_response=True HTTP/1.1" 200 69989
|
|
218
|
-
|
|
219
|
-
12. **Time:** 2025-09-08T08:51:45.310Z
|
|
220
|
-
**Level:** DEBUG
|
|
221
|
-
**Message:** Received response with status 200
|
|
222
|
-
|
|
223
|
-
13. **Time:** 2025-09-08T08:51:45.311Z
|
|
224
|
-
**Level:** DEBUG
|
|
225
|
-
**Message:** Response datasource_type: <class 'dict'>
|
|
226
|
-
|
|
227
|
-
14. **Time:** 2025-09-08T08:51:45.312Z
|
|
228
|
-
**Level:** INFO
|
|
229
|
-
**Message:** Successfully processed /v1/assistants request to typing.List[codemie_sdk.models.assistant.AssistantBase]
|
|
230
|
-
|
|
231
|
-
15. **Time:** 2025-09-08T08:51:45.314Z
|
|
232
|
-
**Level:** DEBUG
|
|
233
|
-
**Message:** Making /v1/workflows request to https://codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com/code-assistant-api<class 'dict'>
|
|
234
|
-
|
|
235
|
-
16. **Time:** 2025-09-08T08:51:45.314Z
|
|
236
|
-
**Level:** DEBUG
|
|
237
|
-
**Message:** Request body: {'project': 'codemie', 'name': 'sdp_xpgivblpavtdeza', 'description': 'Test Workflow', 'yaml_config': 'enable_summarization_node: false\\ntools: []\\nassistants:\\n- id: sdp_xjwyipzcypfocwq\\n model: gpt-4o-2024-08-06\\n assistant_id: 6ef6a01d-70ef-4211-a385-8c99b87eee72\\nstates:\\n- id: ...
|
|
238
|
-
|
|
239
|
-
17. **Time:** 2025-09-08T08:51:45.315Z
|
|
240
|
-
**Level:** DEBUG
|
|
241
|
-
**Message:** Starting new HTTPS connection (1): codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com:443
|
|
242
|
-
|
|
243
|
-
18. **Time:** 2025-09-08T08:51:45.394Z
|
|
244
|
-
**Level:** DEBUG
|
|
245
|
-
**Message:** https://codemie-azure.eks-sandbox.aws.main.edp.projects.epam.com:443 "POST /code-assistant-api/v1/workflows HTTP/1.1" 200 2119
|
|
246
|
-
|
|
247
|
-
19. **Time:** 2025-09-08T08:51:45.394Z
|
|
248
|
-
**Level:** DEBUG
|
|
249
|
-
**Message:** Received response with status 200
|
|
250
|
-
|
|
251
|
-
20. **Time:** 2025-09-08T08:51:45.394Z
|
|
252
|
-
**Level:** DEBUG
|
|
253
|
-
**Message:** Response datasource_type: <class 'dict'>
|
|
205
|
+
Here are the logs from the first page for test item ID 111487:
|
|
206
|
+
|
|
207
|
+
| Time | Level | Message |
|
|
208
|
+
|-------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------|
|
|
209
|
+
| 2025-10-08T10:02:41.368Z | DEBUG | Starting new HTTPS connection (1): keycloak.eks-core.aws.main.edp.projects.epam.com:443 |
|
|
210
|
+
| 2025-10-08T10:02:41.647Z | DEBUG | https://keycloak.eks-core.aws.main.edp.projects.epam.com:443 "POST /auth/realms/codemie-prod/protocol/openid-connect/token HTTP/1.1" 200 2500 |
|
|
211
|
+
| 2025-10-08T10:02:41.651Z | INFO | Plugin key: f6455cc5-af78-4420-86a9-965ac6f0425e |
|
|
212
|
+
| 2025-10-08T10:02:41.652Z | DEBUG | Making /v1/settings/project request to https://codemie-preview.lab.epam.com/code-assistant-api<class 'dict'> |
|
|
213
|
+
| 2025-10-08T10:02:41.652Z | DEBUG | Request body: {'project_name': 'codemie', 'alias': 'cfs_qlbpwnkmgoqgkcc', 'default': False, 'is_global': False, 'credential_type': <CredentialTypes.PLUGIN: 'Plugin'>, 'credential_values': [{'key': 'url', 'value': 'AUTO_GENERATED'}, {'key': 'plugin_key', 'value': 'f6455cc5-af78-4420-86a9-965ac6f0425e'}], 'setting_type': <IntegrationType.PROJECT: 'project'>} |
|
|
214
|
+
| 2025-10-08T10:02:41.653Z | DEBUG | Starting new HTTPS connection (1): codemie-preview.lab.epam.com:443 |
|
|
215
|
+
| 2025-10-08T10:02:42.051Z | DEBUG | https://codemie-preview.lab.epam.com:443 "POST /code-assistant-api/v1/settings/project HTTP/1.1" 200 41 |
|
|
216
|
+
| 2025-10-08T10:02:42.052Z | DEBUG | Received response with status 200 |
|
|
217
|
+
| 2025-10-08T10:02:42.052Z | DEBUG | Response datasource_type: <class 'dict'> |
|
|
218
|
+
| 2025-10-08T10:02:42.060Z | INFO | Successfully processed /v1/settings/project request to <class 'dict'> |
|
|
219
|
+
| 2025-10-08T10:02:42.060Z | DEBUG | Making /v1/settings/project request to https://codemie-preview.lab.epam.com/code-assistant-apityping.List[codemie_sdk.models.integration.Integration] |
|
|
220
|
+
| 2025-10-08T10:02:42.061Z | DEBUG | Request params: {'page': 0, 'per_page': 200} |
|
|
221
|
+
| 2025-10-08T10:02:42.062Z | DEBUG | Starting new HTTPS connection (1): codemie-preview.lab.epam.com:443 |
|
|
222
|
+
| 2025-10-08T10:02:42.562Z | DEBUG | https://codemie-preview.lab.epam.com:443 "GET /code-assistant-api/v1/settings/project?page=0&per_page=200 HTTP/1.1" 200 93345 |
|
|
223
|
+
| 2025-10-08T10:02:42.573Z | DEBUG | Received response with status 200 |
|
|
224
|
+
| 2025-10-08T10:02:42.573Z | DEBUG | Response datasource_type: <class 'dict'> |
|
|
225
|
+
| 2025-10-08T10:02:42.585Z | INFO | Successfully processed /v1/settings/project request to typing.List[codemie_sdk.models.integration.Integration] |
|
|
226
|
+
| 2025-10-08T10:02:42.647Z | DEBUG | Making /v1/settings/project request to https://codemie-preview.lab.epam.com/code-assistant-apityping.List[codemie_sdk.models.integration.Integration] |
|
|
227
|
+
| 2025-10-08T10:02:42.647Z | DEBUG | Request params: {'page': 0, 'per_page': 200} |
|
|
228
|
+
| 2025-10-08T10:02:42.649Z | DEBUG | Starting new HTTPS connection (1): codemie-preview.lab.epam.com:443 |
|
|
229
|
+
|
|
230
|
+
If you need additional pages of logs, please let me know.
|
|
254
231
|
""",
|
|
255
232
|
),
|
|
256
233
|
(
|
|
@@ -26,7 +26,7 @@ search_tools_test_data = [
|
|
|
26
26
|
interactions_tools_test_data = [
|
|
27
27
|
(
|
|
28
28
|
ResearchToolName.GOOGLE_PLACES,
|
|
29
|
-
"Find McDonald in the Kyiv on the Khreschatyk
|
|
29
|
+
"Find McDonald in the Kyiv on the Khreschatyk, 19-a",
|
|
30
30
|
"""
|
|
31
31
|
I found a McDonald's location on Khreschatyk Street in Kyiv:
|
|
32
32
|
McDonald's
|
|
@@ -40,12 +40,34 @@ interactions_tools_test_data = [
|
|
|
40
40
|
ResearchToolName.GOOGLE_PLACES_FIND_NEAR,
|
|
41
41
|
"Find McDonalds in the Kyiv near Khreschatyk in radius 2 km",
|
|
42
42
|
"""
|
|
43
|
-
I found
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
I found several McDonald's locations near Khreschatyk in Kyiv, within a 2 km radius. However, all these locations are temporarily closed. Here are the details:
|
|
44
|
+
|
|
45
|
+
1. **McDonald's**
|
|
46
|
+
- **Address:** Sofiivs'ka St, 1/2, Kyiv
|
|
47
|
+
- **Rating:** 4.3 based on 11,090 reviews
|
|
48
|
+
- **[View Photo](https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=AciIO2fMNnp003CQSug6AmJuJXZ0myKILfuo4iNiSDpi6mTJm2zgnwFbWazL-5UC9MGU6e8TZ5jzorgsFj3QfmeEuICUKkKv9vvgKWXItQo4h2TdXgNxV2U-WHuz-cLDT0d56YoVpRFxjitp1Fmly-XEwhZj_UqgVW2d2qAI5lwjk4_aLdbZznWWZ212blOjpF4VY987Q8D9wVEUHnl-y72Ev6A7ywNvV3VJKGuE5szP6JRj7GI9r-0ToIuC8dub3-lkgyQUuF56Sfki6M46ePndL5mk-KIuJOfH54EINyBqp-z3Q9xA85T93pCcW6bMxDk5XqfG7nQfpZr5yO8-zfJj51NNJzjF8vsevvfXDIoUVDGXNJfllLcXCxA6uaoYHK0ynmMaX4_6X_R2FtM_UoimzUuw9cqQPBK_FryGvD9qO5Bx7zW_HMb3D6TMax2iNtSrkwd59Bz7XC4ud6MqdoWn7rXGR_Z52XR1KaGFnFMW_4NI0MI6_hFVjvUBp7xnzvfABaaG5o2imuVRzf4khUthFRyXTil8ht36C-ijIVvg8HdODerT8LN6IoV4pCg5XekDNpIqxhJf)**
|
|
49
|
+
|
|
50
|
+
2. **McDonald's**
|
|
51
|
+
- **Address:** Khreschatyk St, 19-a, Kyiv
|
|
52
|
+
- **Rating:** 4.4 based on 21,848 reviews
|
|
53
|
+
- **[View Photo](https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=AciIO2fLPseD2rR9t8necj88rGG-3xzeNQGmho05h5SQ7i8tjQ8zG0wPEbLXz0m0ZzKxR6inczyc5GW_8WkJ5PmuDJLXYuEB0-pwow4tdnXkW5GynclZsRklxzEAV49X7IBsLXSaw1-WhISnkEWYMzb8PM6WkORf_IKBw8cD6AsQ93rLMusReVT37Cwo9ZiCqaOeMTDyc7MSN9Md7MhN0ezi-cphTe6VfFT9zMPSVyM-_yjb9bjzHsFjnK343C1QjMIZeBdRwz-Raw68xvecUu9FF6JLx8vPlW8kkbgdS9p9DX7AAS3NccBwFEBEGPryDYCzNKHew_0NRqcaQW9KQfWPuBeApArqbEXyeVCRdCPe0MwOy4wQER9_PtnaltlfKGBHD8fAWH3hS35erkkQE6GQ7_5KQxExVsXSq7hiVxUd_Mh0geOT2KSUl7A8Gkcq3AbqeTXTp5V6454vX-yq55WEpCUvdB6DJNGGxdCO8q4YJm3SuEyyN3B4f3QIg2HsiOVv9KPK3A29hYsX_IGgDcwsD720zltJEYbIevGZ3OtFrv_Yp-kGDBaYPmZD-M6i8qy6zS7aTfkWNLjcjQ)**
|
|
54
|
+
|
|
55
|
+
3. **McDonald's**
|
|
56
|
+
- **Address:** Velyka Vasylkivska St, 22, Kyiv
|
|
57
|
+
- **Rating:** 4.3 based on 10,710 reviews
|
|
58
|
+
- **[View Photo](https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=AciIO2dOxDjqq7UHyeqKwh9VO8o9uq3iqfWDPLgVKMwwwjBhmb3cG2rAohIjtemD29g67NcsKzx-dWVqsmkRkqz8XhU6HlbrJEtq_TL7xVYQTImFHXq9kElkR9I0gnpA-rDZoD_RYlcmuRKURTNom8VC6sjzszcozz6QNwjOnl7f55MJq6O9eoJQ0g3iu-ecXGt6bELpx2oa9urOqqjrapGH4yKOQKPp_36MEJVkuD6IohzuLMqpQdlIlNp8WP7SiEZb9CD1DalNuk5H__jsZ35zMKVCpWYMnkZGSN0_-DOFrfXnhC-b6MKYrB_9D6pUjpsfIPvi2qHHf4LRho-P2OR71g1P7WlRf25h1g9DdX3uMe7kMtU0sxRvUMSiAe6Sy9D8s7qrIEb8DcfFQxkFgoQs6fTb-RCEKAwqQtMlJ96nd2kmRU100MDSWsiUy7ifLn6LK343O9_e-RJyobXSo8WovvUs1QxA2kh2z6UMHVxorNPV5wclkE3J3cLYzUTvL5P7t3OBDVGiTdcPzE-5Z7P63VF-jUHU9Hv2l6-KHjwa4r8wIDgB7shW_iJEuHgv04NxD2p95onx)**
|
|
59
|
+
|
|
60
|
+
4. **McDonald's**
|
|
61
|
+
- **Address:** Borychiv Descent, 10А, Kyiv
|
|
62
|
+
- **Rating:** 4.5 based on 14,818 reviews
|
|
63
|
+
- **[View Photo](https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=AciIO2efC3DMYMgEycgpEkR5IhrJIwufUliminn1HZmICsch982EeMsgXS9kKkZRvOkvWnnI-os45avQFWAUFR_bWy8R2BwGbW1V37En8BwrFVGznWkIEFZeCVTVPI_s8K4Hj77_l5WLzYnh5wCMCsPZQtTjk26CdvM3Kg1MdJQdZAIFcc26jErp3h6bw7MRY245XbVl2w-41jSOlayQ8voyUUtVVzeGgKVN1kUh-cc2An72nvGjdBQP2S-_8pwGJ5Sz0CcakvCT2VnAdTKz4ywZ5pNxdpKRz17wPvQAkj9jdKrHN5J5jmqjUu_QQFMFfkfNR2P6OEaNxMT5mPizohzU7e1_A3dWHRZxB9bAmxZ9EpQkyeZb3ppwtM24pCkSQ8Cz_9b8qBLleIWolLtXBLyTM54z4XtCSlc-X1wmjyIkca6Cd5D_8jafJbd10uj6wiA5VdhWcv1l_yJSnq0-0t1STfqI0VUVITpAEEU0ZB0TTheuQUuLa6quMjzU8fnYiMzh9YyY8CrLt8xXEMuOwPJrh94iA4-5AKOeJO4LPVehpNdKVWLKXYEwfilMaouuEHheVBS6ANRn)**
|
|
64
|
+
|
|
65
|
+
5. **McDonald's**
|
|
66
|
+
- **Address:** Bohdana Khmel'nyts'koho St, 40/25, Kyiv
|
|
67
|
+
- **Rating:** 4.3 based on 6,187 reviews
|
|
68
|
+
- **[View Photo](https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=AciIO2eeKwvPbZ89_onqK5_s5Zv8kV5TxY5ZIM5ZwR-q8vPuyxAhXp-X6A4LDdLQEtBc3WhH3IJtIiwf6wSqGqLQeuoxIzUqqTR1VM2bYp1FfQwVhVrTVf2bHixPt1z847PYQMCO4ibGE1c0EUQI8S6K_2SnCvmb0PO8AC5GMY-ociHR6rbR8QEiKnYFSd04w349_u-f_q8kntKLS1TnOphOhOFatS_TJFS8AO8JQbV9jILByYncmH6dkQxw7eqqpY--bFjk5y3n1bsP0haKdyLGRwN3d0aqFkRUvtqNPg7KU1Hx0_5uwBb4C_o4XXZXvWhi_fwanNTF_XpyTTcrmw_7IerLVMhoZmM89j3Un8qQi7_prhJBT3Un3zwLKvXs-cr4R9StGn_dT9D73RoOGHP16wjSrfCZ8BMNBM6JgqTxKzLjvf8yGKWeYs5pTctcjcsqw_vc9cOhTHewN2wcRc_AdQ6Snj191P6UiVUGnytXyhKCM6yjOXvVjNLjbDNfZz5CeJZjsNJDuL7kH64vG_EQgR5eHqQUTVWD2Fm7wJE-YtP2MtOGEptncDVQtRSt6ALBj0kUi9t3)**
|
|
69
|
+
|
|
70
|
+
Please note that the status may change, so it's advisable to check the latest updates before making plans.
|
|
49
71
|
""",
|
|
50
72
|
),
|
|
51
73
|
(
|
|
@@ -109,6 +109,7 @@ class AssistantUtils(BaseUtils):
|
|
|
109
109
|
conversation_id=None,
|
|
110
110
|
history=(),
|
|
111
111
|
output_schema=None,
|
|
112
|
+
extract_failed_tools=False,
|
|
112
113
|
):
|
|
113
114
|
chat_request = AssistantChatRequest(
|
|
114
115
|
text=user_prompt,
|
|
@@ -129,18 +130,21 @@ class AssistantUtils(BaseUtils):
|
|
|
129
130
|
return response.generated
|
|
130
131
|
else:
|
|
131
132
|
# Extract triggered tools from response thoughts
|
|
132
|
-
triggered_tools = self._extract_triggered_tools(
|
|
133
|
+
triggered_tools = self._extract_triggered_tools(
|
|
134
|
+
response, extract_failed_tools
|
|
135
|
+
)
|
|
133
136
|
return response.generated, triggered_tools
|
|
134
137
|
|
|
135
|
-
def _extract_triggered_tools(self, response):
|
|
138
|
+
def _extract_triggered_tools(self, response, extract_failed_tools):
|
|
136
139
|
"""
|
|
137
140
|
Extract triggered tools from response thoughts.
|
|
138
141
|
|
|
139
|
-
Filters out 'Codemie Thoughts' entries and error entries,
|
|
142
|
+
Filters out 'Codemie Thoughts' entries and optionally error entries,
|
|
140
143
|
returning a list of tool names in lowercase.
|
|
141
144
|
|
|
142
145
|
Args:
|
|
143
146
|
response: The assistant response containing thoughts
|
|
147
|
+
extract_failed_tools: If True, include tools that failed with errors
|
|
144
148
|
|
|
145
149
|
Returns:
|
|
146
150
|
list: List of triggered tool names in lowercase
|
|
@@ -148,15 +152,21 @@ class AssistantUtils(BaseUtils):
|
|
|
148
152
|
triggered_tools = []
|
|
149
153
|
|
|
150
154
|
# Check if response has thoughts attribute
|
|
151
|
-
if hasattr(response, "thoughts") and response.thoughts:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
if not (hasattr(response, "thoughts") and response.thoughts):
|
|
156
|
+
return triggered_tools
|
|
157
|
+
|
|
158
|
+
for thought in response.thoughts:
|
|
159
|
+
author_name = thought.get("author_name", "")
|
|
160
|
+
|
|
161
|
+
# Skip if no author name or if it's 'Codemie Thoughts'
|
|
162
|
+
if not author_name or author_name == "Codemie Thoughts":
|
|
163
|
+
continue
|
|
164
|
+
|
|
165
|
+
# If not extracting failed tools, skip error entries
|
|
166
|
+
if not extract_failed_tools and thought.get("error", False):
|
|
167
|
+
continue
|
|
168
|
+
|
|
169
|
+
triggered_tools.append(author_name.lower())
|
|
160
170
|
|
|
161
171
|
return triggered_tools
|
|
162
172
|
|