Skip to main content

Testing data Next Gen UI

Project description

Next Gen UI Agent Testing

This module is part of the Next Gen UI Agent project.

Module Category Module Status

Library for testing support

Components

  • model.py - MockedInference to mock agent's InferenceBase in unit tests
  • agent_testing.py - Test setup for renderer testing with mock agents
  • data_set_movies.py - Comprehensive movie database with tool functions for E2E testing
    • MOVIES_DB: Rich dataset with 6 movies including box office data, ratings, awards, and weekly performance
    • search_movie(title): Search for a specific movie by title
    • get_all_movies(**filters): Get movies with optional filtering by director, genre, actor, year, rating
    • find_movie(title): Legacy function for backward compatibility
  • movies_agent_example.py - E2E testing agent demonstrating LangGraph ReAct agent with movie tools
    • create_movies_agent(llm, system_prompt): Factory function to create a movies agent
    • run_example(): Runnable example demonstrating the agent in action
  • data_after_transformation - Distinct types of ComponentData based on movies data for use in tests

Usage

For Renderer Testing

from next_gen_ui_testing.agent_testing import create_mock_agent

For E2E Testing

from next_gen_ui_testing.data_set_movies import get_all_movies, search_movie
from next_gen_ui_testing.movies_agent_example import create_movies_agent

# Create agent
movies_agent = create_movies_agent(llm)
agent_graph = movies_agent.build_graph()

# Run query
result = await agent_graph.ainvoke({"messages": [("user", "Show me sci-fi movies")]})

Running the Example

cd libs/next_gen_ui_testing
export LLM_MODEL="your-model"
export LLM_BASE_URL="http://your-api/v1"
export LLM_API_KEY="your-key"
python -m next_gen_ui_testing.movies_agent_example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

next_gen_ui_testing-0.4.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file next_gen_ui_testing-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for next_gen_ui_testing-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21ee8aa2484f04557e9940fe36715e457145f67cebfcafb4c2d74ced696d2dcb
MD5 3a1c1f0610596e38fec031670113cc42
BLAKE2b-256 df7080992cb3521eb20d3e4f4c6f4556c700148447578e7b621ae96dab75b1e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page