Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/pr_labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ sam-mcp-server-gateway-adapter:
sam-event-mesh-identity-provider:
- changed-files:
- any-glob-to-any-file: sam-event-mesh-identity-provider/**
sam-powerbi:
- changed-files:
- any-glob-to-any-file: sam-powerbi/**

1 change: 1 addition & 0 deletions .github/workflows/build-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ on:
- sam-sql-database-tool
- sam-webhook-gateway
- sam-event-mesh-identity-provider
- sam-powerbi
ref:
description: "Git ref to checkout (branch or SHA)"
required: false
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deprecate-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ on:
required: false
type: boolean
default: false
sam-powerbi:
description: "Deprecate sam-powerbi"
required: false
type: boolean
default: false
sam-rag:
description: "Deprecate sam-rag"
required: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-plugin-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ on:
- "!sam-sql-database-tool/**"
- "!sam-webhook-gateway/**"
- "!sam-event-mesh-identity-provider/**"
- "!sam-powerbi/**"

permissions:
contents: write
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"sam-mcp-server-gateway-adapter": "0.1.1",
"sam-mongodb": "0.1.1",
"sam-nuclia-tool": "0.1.3",
"sam-powerbi": "0.1.0",
"sam-rag": "0.1.2",
"sam-rest-gateway": "0.2.1",
"sam-ruleset-lookup-tool": "0.1.1",
Expand Down
4 changes: 4 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
"package-name": "sam_nuclia_tool",
"changelog-path": "CHANGELOG.md"
},
"sam-powerbi": {
"package-name": "solace_agent_mesh_powerbi",
"changelog-path": "CHANGELOG.md"
},
"sam-rag": {
"package-name": "sam_rag",
"changelog-path": "CHANGELOG.md",
Expand Down
17 changes: 17 additions & 0 deletions sam-powerbi/.fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuration used for fossa scan
version: 3

project:
locator: SolaceLabs_sam-powerbi
id: SolaceLabs_sam-powerbi
name: sam-powerbi
labels:
- solaceai
- solace-agent-mesh-core-plugins

vendoredDependencies:
forceRescans: false
scanMethod: CLILicenseScan

telemetry:
scope: full
55 changes: 55 additions & 0 deletions sam-powerbi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SamPowerbi SAM Plugin

PowerBI executeQueries tool with MSAL device-code delegated auth

This is a plugin for Solace Agent Mesh (SAM).

## About Solace Agent Mesh

Solace Agent Mesh (SAM) is an open-source framework for building event-driven, multi-agent AI systems where specialized agents collaborate on complex tasks. It provides a standardized way for agents to communicate, share data, and integrate with external systems while keeping components loosely coupled and production-ready.

SAM helps you:

- Build event-driven multi-agent systems on Solace Event Mesh
- Connect agents, tools, gateways, and services through a common runtime
- Extend projects with installable plugins such as `sam-nuclia-tool`

Learn more in the [Solace Agent Mesh documentation](https://solacelabs.github.io/solace-agent-mesh/) and the [main project repository](https://github.com/SolaceLabs/solace-agent-mesh).

## Features

This agent connects to Power BI via the Power BI REST API to retrieve, analyze, and summarize data from reports and datasets.
It can execute DAX queries against published datasets, fetch report metadata, and translate natural language questions into structured queries — returning insights without requiring the user to navigate the Power BI interface directly.

- **Natural Language to DAX query:** Translate the user's question into a valid DAX query

## Configuration

### Environment Variables

Set the following environment variables for your MongoDB connection:

```bash
export AZURE_TENANT_ID="your azure tenant id"
export POWERBI_CLIENT_ID="your powerBI client id"
export POWERBI_WORKSPACE_ID="your powerBI workspace id"
export POWERBI_SEMANTIC_MODEL_ID="your semantic model id"
export POWERBI_TOKEN_CACHE="your location for your token-cahe, default /tmp/samv2/powerbi_msal_cache.json"
```

## Build

To build the PowerBI Agent plugin, run the following command:
```bash\
sam plugin build
```

## Installation

To install the PowerBI Agent plugin, run the following command:

```bash
sam plugin install sam-powerbi
```

This will create a new component configuration at `configs/plugins/<your-new-component-name-kebab-case>.yaml`.
104 changes: 104 additions & 0 deletions sam-powerbi/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Plugin Metadata:
# Name: sam-powerbi
# Version: 0.1.0
# Description: A PowerBI plugin for executing queries with MSAL device-code delegated auth
# Author: SolaceLabs solacelabs@solace.com

log:
stdout_log_level: INFO
log_file_level: DEBUG
log_file: __COMPONENT_KEBAB_CASE_NAME__.log

# To use the `shared_config.yaml` file, uncomment the following line and remove the `shared_config` section below.
# !include ../shared_config.yaml
shared_config:
- broker_connection: &broker_connection
dev_mode: ${SOLACE_DEV_MODE, false}
broker_url: ${SOLACE_BROKER_URL, ws://localhost:8008}
broker_username: ${SOLACE_BROKER_USERNAME, default}
broker_password: ${SOLACE_BROKER_PASSWORD, default}
broker_vpn: ${SOLACE_BROKER_VPN, default}
temporary_queue: ${USE_TEMPORARY_QUEUES, true}

- models:
general: &general_model
# This dictionary structure tells ADK to use the LiteLlm wrapper.
# 'model' uses the specific model identifier your endpoint expects.
model: ${LLM_SERVICE_GENERAL_MODEL_NAME} # Use env var for model name
# 'api_base' tells LiteLLM where to send the request.
api_base: ${LLM_SERVICE_ENDPOINT} # Use env var for endpoint URL
# 'api_key' provides authentication.
api_key: ${LLM_SERVICE_API_KEY} # Use env var for API key

- services:
# Default session service configuration
session_service: &default_session_service
type: "memory"
default_behavior: "PERSISTENT"

# Default artifact service configuration
artifact_service: &default_artifact_service
type: "filesystem"
base_path: "/tmp/samv2"
artifact_scope: namespace # Or "namespace", "app", "custom"

apps:
- name: __COMPONENT_KEBAB_CASE_NAME__-app
app_base_path: .
app_module: solace_agent_mesh.agent.sac.app
broker:
<<: *broker_connection

# App Level Config
app_config:
namespace: ${NAMESPACE}
supports_streaming: true
agent_name: "__COMPONENT_PASCAL_CASE_NAME__"
display_name: "__COMPONENT_SPACED_CAPITALIZED_NAME__ Agent"
model: *general_model
model_provider:
- "general"

instruction: |
You're __COMPONENT_SPACED_CAPITALIZED_NAME__ agent.
Configure its specific instructions here.

tools:
- group_name: artifact_management
tool_type: builtin-group

# --- Example Python Tools (defined in tools.py) ---
# - tool_type: python
# component_module: sam_powerbi.tools
# component_base_path: . # Relative to where the agent runs
# function_name: example_text_processor_tool
# tool_config:
# prefix: "PluginProcessed: "

# - tool_type: python
# component_module: sam_powerbi.tools
# component_base_path: .
# function_name: example_file_creator_tool
# tool_config: {} # Add specific config if needed by the tool

session_service: *default_session_service
artifact_service: *default_artifact_service

artifact_handling_mode: "reference"
enable_embed_resolution: true
enable_artifact_content_instruction: true

agent_card:
description: "PowerBI executeQueries tool with MSAL device-code delegated auth"
defaultInputModes: ["text"]
defaultOutputModes: ["text"]
skills: [] # Remove brackets after adding entries
# - id: "example_tool"
# name: "Example Tool"
# description: "An example tool provided by the SamPowerbi plugin."

agent_card_publishing: { interval_seconds: 10 }
agent_discovery: { enabled: false }
inter_agent_communication:
allow_list: []
request_timeout_seconds: 30
62 changes: 62 additions & 0 deletions sam-powerbi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

[tool.sam_powerbi.metadata]
type = "tool"

[project]
name = "sam_powerbi"
version = "0.1.0"
authors = [
{ name="SolaceLabs", email="solacelabs@solace.com" },
]
description = "A PowerBI plugin for executing queries with MSAL device-code delegated auth"
readme = "README.md"
requires-python = ">=3.10.16,<3.14"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
dependencies = [
"msal>=1.34",
"httpx>=0.27",
]

Comment thread
peetkes marked this conversation as resolved.
[project.urls]
Homepage = "https://github.com/SolaceLabs/solace-agent-mesh"
Documentation = "https://solacelabs.github.io/solace-agent-mesh/"
Repository = "https://github.com/SolaceLabs/solace-agent-mesh-core-plugins"
Issues = "https://github.com/SolaceLabs/solace-agent-mesh-core-plugins/issues"

[tool.hatch.build.targets.wheel]
packages = ["src/sam_powerbi"]
src-path = "src"

[tool.hatch.build.targets.wheel.force-include]
"config.yaml" = "sam_powerbi/config.yaml"
"README.md" = "sam_powerbi/README.md"
"pyproject.toml" = "sam_powerbi/pyproject.toml"

[tool.pytest.ini_options]
asyncio_mode = "auto"
addopts = "--tb=short --strict-markers --disable-warnings -p pytest_asyncio"

[tool.hatch.envs.hatch-test]
dependencies = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"pytest-mock>=3.0.0",
"pytest-cov>=4.0.0",
"pytest-json-ctrf>=0.1.0",
"pytest-xdist>=3.5.0",
"sam-test-infrastructure @ git+https://github.com/SolaceLabs/solace-agent-mesh#subdirectory=tests/sam-test-infrastructure"
]
35 changes: 35 additions & 0 deletions sam-powerbi/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SonarQube Configuration for sam-powerbi
sonar.projectKey=SolaceLabs_sam-powerbi
sonar.projectName=sam-powerbi

# Source and Test Directories
sonar.sources=src/
sonar.tests=tests/

# Python Configuration
sonar.python.version=3.10,3.11,3.12,3.13

# Coverage Configuration
sonar.python.coverage.reportPaths=**/coverage.xml

# Source Encoding
sonar.sourceEncoding=UTF-8

# Exclusions
sonar.exclusions=\
**/__pycache__/**,\
**/dist/**,\
**/.hatch/**,\
**/build/**,\
**/*.egg-info/**,\
**/tests/**

# Duplication Exclusions
sonar.cpd.exclusions=\
**/tests/**

# Test Inclusions
sonar.test.inclusions=\
**/tests/**/*.py,\
**/test_*.py,\
**/*_test.py
Empty file.
Loading
Loading