Skip to content

Commit c5f43d8

Browse files
fix: fix envs for evaluator and add copyright header check (#21)
* chore:add license checker * add file header for remote ve agent * fix envs get * add file header
1 parent 3d956b9 commit c5f43d8

File tree

10 files changed

+166
-36
lines changed

10 files changed

+166
-36
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: License Header Check
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
License-Check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Check License Header
16+
uses: apache/skywalking-eyes/[email protected]

.licenserc.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
header:
2+
- license:
3+
spdx-id: Apache-2.0
4+
copyright-owner: Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates
5+
content: |
6+
Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
7+
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
20+
paths:
21+
- '**/*.py'
22+
23+
comment: on-failure

veadk/a2a/remote_ve_agent.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import json
216

317
import requests

veadk/cli/studio/fast_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import json
216
import os
317
import uuid

veadk/cli/studio/models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
from pydantic import BaseModel
216

317

veadk/cli/studio/studio_processor.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import os
216

317
from deepeval.metrics import GEval

veadk/evaluation/deepeval_evaluator/deepeval_evaluator.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@
2121
from deepeval.models import LocalModel
2222
from deepeval.test_case import LLMTestCase
2323
from deepeval.test_case.llm_test_case import ToolCall
24+
from pydantic import Field
2425
from typing_extensions import override
2526

2627
from veadk.config import getenv
28+
from veadk.evaluation.types import EvalResultCaseData, EvalResultMetadata
2729
from veadk.utils.logger import get_logger
2830

2931
from ..base_evaluator import BaseEvaluator, EvalResultData, MetricResult
30-
from ..utils.prometheus import (
31-
EvalResultCaseData,
32-
EvalResultMetadata,
33-
PrometheusPushgatewayConfig,
34-
push_to_prometheus,
35-
)
32+
from ..utils.prometheus import PrometheusPushgatewayConfig, push_to_prometheus
3633

3734
logger = get_logger(__name__)
3835

@@ -46,14 +43,23 @@ class DeepevalEvaluator(BaseEvaluator):
4643
def __init__(
4744
self,
4845
agent,
49-
judge_model_api_key: str = getenv("MODEL_JUDGE_API_KEY"),
50-
judge_model_name: str = getenv(
51-
"MODEL_JUDGE_NAME",
52-
"doubao-seed-1-6-250615",
46+
judge_model_api_key: str = Field(
47+
...,
48+
default_factory=lambda: getenv("MODEL_JUDGE_API_KEY"),
5349
),
54-
judge_model_api_base: str = getenv(
55-
"MODEL_JUDGE_API_BASE",
56-
"https://ark.cn-beijing.volces.com/api/v3/",
50+
judge_model_name: str = Field(
51+
...,
52+
default_factory=lambda: getenv(
53+
"MODEL_JUDGE_NAME",
54+
"doubao-seed-1-6-250615",
55+
),
56+
),
57+
judge_model_api_base: str = Field(
58+
...,
59+
default_factory=lambda: getenv(
60+
"MODEL_JUDGE_API_BASE",
61+
"https://ark.cn-beijing.volces.com/api/v3/",
62+
),
5763
),
5864
name: str = "veadk_deepeval_evaluator",
5965
prometheus_config: PrometheusPushgatewayConfig = None,

veadk/evaluation/types.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from dataclasses import dataclass
16+
17+
18+
@dataclass
19+
class EvalResultCaseData:
20+
id: str
21+
input: str
22+
actual_output: str
23+
expected_output: str
24+
score: str
25+
reason: str
26+
status: str # `PASSED` or `FAILURE`
27+
latency: str
28+
29+
30+
@dataclass
31+
class EvalResultMetadata:
32+
tested_model: str
33+
judge_model: str

veadk/evaluation/utils/prometheus.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,34 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from dataclasses import dataclass
1615

1716
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
1817
from prometheus_client.exposition import basic_auth_handler
18+
from pydantic import Field
1919

2020
from veadk.config import getenv
21-
22-
23-
@dataclass
24-
class EvalResultCaseData:
25-
id: str
26-
input: str
27-
actual_output: str
28-
expected_output: str
29-
score: str
30-
reason: str
31-
status: str # `PASSED` or `FAILURE`
32-
latency: str
33-
34-
35-
@dataclass
36-
class EvalResultMetadata:
37-
tested_model: str
38-
judge_model: str
21+
from veadk.evaluation.types import EvalResultCaseData, EvalResultMetadata
3922

4023

4124
class PrometheusPushgatewayConfig:
42-
url: str = getenv(
43-
"OBSERVABILITY_PROMETHEUS_PUSHGATEWAY_URL",
25+
url: str = Field(
26+
...,
27+
default_factory=lambda: getenv(
28+
"OBSERVABILITY_PROMETHEUS_PUSHGATEWAY_URL",
29+
),
30+
)
31+
username: str = Field(
32+
...,
33+
default_factory=lambda: getenv(
34+
"OBSERVABILITY_PROMETHEUS_USERNAME",
35+
),
36+
)
37+
password: str = Field(
38+
...,
39+
default_factory=lambda: getenv(
40+
"OBSERVABILITY_PROMETHEUS_PASSWORD",
41+
),
4442
)
45-
username: str = getenv("OBSERVABILITY_PROMETHEUS_USERNAME")
46-
password: str = getenv("OBSERVABILITY_PROMETHEUS_PASSWORD")
4743

4844

4945
registry = CollectorRegistry()

0 commit comments

Comments
 (0)