semvec/pypi-packages huggingface dataset:
next-gen-ui-testing 0.4.0
Testing data Next Gen UI
License: Apache-2.0
Requires Python: <3.15,>=3.12

# Next Gen UI Agent Testing

This module is part of the [Next Gen UI Agent project](https://github.com/RedHat-UX/next-gen-ui-agent).

[![Module Category](https://img.shields.io/badge/Module%20Category-Testing/Evaluation-darkmagenta)](https://github.com/RedHat-UX/next-gen-ui-agent)
[![Module Status](https://img.shields.io/badge/Module%20Status-Supported-green)](https://github.com/RedHat-UX/next-gen-ui-agent)

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
```python
from next_gen_ui_testing.agent_testing import create_mock_agent
```

### For E2E Testing
```python
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
```bash
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
```
next-gen-ui-llama-stack-embedded 0.4.0
Embedded Llama-Stack server inference for Next Gen UI Agent
License: Apache-2.0
Requires Python: <3.15,>=3.12

# Next Gen UI Embedded Llama Stack Server Inference

This module is part of the [Next Gen UI Agent project](https://github.com/RedHat-UX/next-gen-ui-agent).

[![Module Category](https://img.shields.io/badge/Module%20Category-AI%20Framework-darkred)](https://github.com/RedHat-UX/next-gen-ui-agent)
[![Module Status](https://img.shields.io/badge/Module%20Status-Supported-green)](https://github.com/RedHat-UX/next-gen-ui-agent)

Support for LLM inference using [Embedded Llama Stack server](https://github.com/meta-llama/llama-stack).

## Provides

* `LlamaStackEmbeddedAsyncAgentInference` to use LLM hosted in embedded Llama Stack server, started from provided [Llama Stack config file](https://llama-stack.readthedocs.io/en/latest/distributions/configuration.html).
* `init_inference_from_env` method to init Llama Stack inference (remote or embedded) based on environment variables
    * `INFERENCE_MODEL` - LLM model to use - inference is not created if undefined (default value can be provided as method parameter)
    * `LLAMA_STACK_HOST` - remote LlamaStack host - if defined then it is used with LLAMA_STACK_PORT to create remote LlamaStack inference
    * `LLAMA_STACK_PORT` - remote LlamaStack port - optional, defaults to `5001`
    * `LLAMA_STACK_URL` - remote LlamaStack url - if `LLAMA_STACK_HOST` is not defined, but this url is defined, then it 
      is used to create remote LlamaStack inference
    * `LLAMA_STACK_CONFIG_FILE` - path to embedded LlamaStack server config file, used only if no remote LlamaStack is configured 
      (default value can be provided as method parameter)
* `examples/llamastack-ollama.yaml` example of the LlamaStack config file to use LLM from [Ollama](https://ollama.com/) running on 
  localhost (with model also taken from `INFERENCE_MODEL` env variable).

## Installation

```sh
pip install -U next_gen_ui_llama_stack_embedded
```

## Example

### Instantiation of `LlamaStackEmbeddedAsyncAgentInference`

```py

from next_gen_ui_llama_stack_embedded import LlamaStackEmbeddedAsyncAgentInference

config_file = "example/llamastack-ollama.yaml"
model = "llama3.2:latest"

inference = LlamaStackEmbeddedAsyncAgentInference(config_file, model)

# init UI Agent using inference

```

### Inference initialization from environment variables

```py
from next_gen_ui_llama_stack_embedded import init_inference_from_env

# default model used if env variable is not defined
INFERENCE_MODEL_DEFAULT = "granite3.3:2b"

inference = init_inference_from_env(default_model=INFERENCE_MODEL_DEFAULT)

if (inference):
    # init UI Agent using inference
else:
    print("Inference not initialized because not configured in env variables")

```

## Links

* [Documentation](https://redhat-ux.github.io/next-gen-ui-agent/guide/ai_apps_binding/llamastack_embedded/)
* [Source Codes](https://github.com/RedHat-UX/next-gen-ui-agent/tree/main/libs/next_gen_ui_llama_stack_embedded)
* [Contributing](https://redhat-ux.github.io/next-gen-ui-agent/development/contributing/)
next-gen-ui-agent 0.4.0
Empower your UI by AI Agent
License: Apache-2.0
Requires Python: <3.15,>=3.12

# Next Gen UI Core Functionality

This module is part of the [Next Gen UI Agent project](https://github.com/RedHat-UX/next-gen-ui-agent).

[![Module Category](https://img.shields.io/badge/Module%20Category-Core-blue)](https://github.com/RedHat-UX/next-gen-ui-agent)
[![Module Status](https://img.shields.io/badge/Module%20Status-Supported-green)](https://github.com/RedHat-UX/next-gen-ui-agent)

This module contains UI Agent Core functionality and frameworks.

## Provides

* `NextGenUIAgent` providing agent configuration and methods for individual processing steps
* `NextGenUIAgent` produced *UI Data Blocks*
    * [LLM selected and configured dynamic components](https://redhat-ux.github.io/next-gen-ui-agent/guide/data_ui_blocks/dynamic_components/)
        * Supported components: `one-card`, `image`, `video-player`, `set-of-cards`, `table`, `chart-bar`, `chart-line`, `chart-pie`, `chart-donut`, `chart-mirrored-bar`
    * [Hand Build Components](https://redhat-ux.github.io/next-gen-ui-agent/guide/data_ui_blocks/hand_build_components/)
    * Extensible framework for "data transformation" step per dynamic component
* Plugable ["UI renderer"](https://redhat-ux.github.io/next-gen-ui-agent/guide/renderer/implementing_serverside/) framework for UI components rendering
    * Default `json` renderer used to send definitions to client-side renderers
* Pluggable and configurable ["Input Data Transformation"](https://redhat-ux.github.io/next-gen-ui-agent/guide/input_data/transformation/) framework
    * Provided transformers: `json`, `yaml`, `csv-comma`, `csv-semicolon`, `csv-tab`, `fwctable`, `noop`
* Abstraction of the [LLM inference](https://redhat-ux.github.io/next-gen-ui-agent/guide/llm/)
    * `InferenceBase` inference interface used by UI Agent
    * `LangChainModelInference` inference implementation using LangChain `chat_models`
    * `ProxiedAnthropicVertexAIInference`  inference implementation to call Anthropic/Claude models from proxied Google Vertex AI API endpoint
    * reusable inference provider builder from commandline arguments/env variables, used by all AI protocol servers

## Installation

```sh
pip install -U next_gen_ui_agent
```

### Interface usage

```py
from next_gen_ui_agent import NextGenUIAgent

inference = # any AI framework inference

agent = NextGenUIAgent(
    inference=LlamaStackInference(model="ollama:llama3.2"),
)

# API is not very friendly ATM, as you have to call methods for individual processing steps. We plan to improve it iit the near future.

```

## Links

* [Documentation](https://redhat-ux.github.io/next-gen-ui-agent/guide/ai_apps_binding/pythonlib/)
* [Source Codes](https://github.com/RedHat-UX/next-gen-ui-agent/tree/main/libs/next_gen_ui_agent)
* [Contributing](https://redhat-ux.github.io/next-gen-ui-agent/development/contributing/)