Skip to content

Akshaya/mocking improvements#656

Merged
akshaylive merged 1 commit intomainfrom
akshaya/mocking_improvements
Oct 9, 2025
Merged

Akshaya/mocking improvements#656
akshaylive merged 1 commit intomainfrom
akshaya/mocking_improvements

Conversation

@akshaylive
Copy link
Collaborator

@akshaylive akshaylive commented Oct 7, 2025

  1. Standardization of errors
    1. UiPathMockResponseGenerationError to represent errors during generation of mocked response.
    2. UiPathNoMockFoundError to represent that the method should not be mocked.
  2. Model selection
  3. Preparing to get use run examples in LLM Mocker.

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.1.78.dev1006561569",

  # Any version from PR
  "uipath>=2.1.78.dev1006560000,<2.1.78.dev1006570000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Oct 7, 2025
@akshaylive akshaylive added the build:dev Create a dev build from the pr label Oct 7, 2025
@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch 7 times, most recently from c31d415 to fb0ca4d Compare October 7, 2025 22:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements mocking improvements by standardizing error handling, adding model selection capabilities, and preparing for example call usage in LLM mocking. The changes introduce custom exception types to replace generic NotImplementedError exceptions and add support for configurable model parameters and example calls in the mocking framework.

  • Standardized error handling with custom UiPath exception types for mocking scenarios
  • Added model parameter configuration support for LLM mocking with temperature, top_p, top_k, etc.
  • Introduced example call functionality to provide context for LLM-based mocking

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/uipath/_cli/_evals/mocks/mocker.py Defines new exception types for mocking error scenarios
src/uipath/_cli/_evals/mocks/mocks.py Updates exception handling and adds example call support to mockable decorator
src/uipath/_cli/_evals/mocks/mockito_mocker.py Implements proper error handling with new exception types
src/uipath/_cli/_evals/mocks/llm_mocker.py Adds model parameter support and example call integration
src/uipath/_cli/_evals/_models/_evaluation_set.py Adds ModelSettings for configurable LLM parameters
src/uipath/_services/llm_gateway_service.py Adds top_k parameter support to chat completions
src/uipath/agent/models/agent.py Introduces BaseResourceProperties with example calls
tests/cli/eval/mocks/test_mocks.py Updates tests to use new exception types
samples/calculator/main.py Demonstrates example call usage in mockable decorator
samples/calculator/evals/eval-sets/default.json Shows model configuration in evaluation set

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch from fb0ca4d to 2dc9e0a Compare October 8, 2025 15:10
@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch from 2dc9e0a to 47c0b3c Compare October 8, 2025 16:09
@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch from 47c0b3c to 2b3f61e Compare October 9, 2025 00:08
@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch from 2b3f61e to da60163 Compare October 9, 2025 15:23
1. Standardization of errors
  1. `UiPathMockResponseGenerationError` to represent errors during generation of mocked response.
  2. `UiPathNoMockFoundError` to represent that the method should not be mocked.
2. Model selection
3. Allow run examples in LLM Mocker.

# Conflicts:
#	pyproject.toml
@akshaylive akshaylive force-pushed the akshaya/mocking_improvements branch from da60163 to ff2c05d Compare October 9, 2025 15:38
@akshaylive akshaylive merged commit 1566930 into main Oct 9, 2025
55 checks passed
@akshaylive akshaylive deleted the akshaya/mocking_improvements branch October 9, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants