Skip to content

Commit a49cf5a

Browse files
authored
Merge branch 'main' into fix/specify-loglevel
2 parents 87c3713 + 178f1b0 commit a49cf5a

File tree

2 files changed

+69
-11
lines changed

2 files changed

+69
-11
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Copyright 2025 The Dapr Authors
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+
# http://www.apache.org/licenses/LICENSE-2.0
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
#
13+
14+
name: dapr-bot-schedule
15+
16+
on:
17+
schedule:
18+
- cron: '*/10 * * * *'
19+
workflow_dispatch:
20+
21+
permissions:
22+
actions: write
23+
issues: write
24+
pull-requests: write
25+
26+
jobs:
27+
prune_stale:
28+
name: Prune Stale
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Prune Stale
32+
uses: actions/stale@v10
33+
with:
34+
stale-issue-message: >
35+
This issue has been automatically marked as stale because it has not had activity in the
36+
last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity
37+
occurs. Thank you for your contributions.
38+
close-issue-message: >
39+
This issue has been automatically closed because it has not had activity in the
40+
last 67 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved.
41+
Thank you for your contributions.
42+
stale-pr-message: >
43+
This pull request has been automatically marked as stale because it has not had
44+
activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Please
45+
feel free to give a status update now, ping for review, or re-open when it's ready.
46+
Thank you for your contributions!
47+
close-pr-message: >
48+
This pull request has been automatically closed because it has not had
49+
activity in the last 67 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
50+
Thank you for your contributions!
51+
stale-issue-label: 'stale'
52+
exempt-issue-labels: 'pinned,good first issue,help wanted,triaged/resolved'
53+
stale-pr-label: 'stale'
54+
exempt-pr-labels: 'pinned'
55+
operations-per-run: 500
56+
ascending: true

dapr_agents/tool/base.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import inspect
24
import logging
35
from typing import TYPE_CHECKING, Callable, Type, Optional, Any, Dict
@@ -80,10 +82,10 @@ def from_func(cls, func: Callable) -> "AgentTool":
8082
@classmethod
8183
def from_mcp(
8284
cls,
83-
mcp_tool: "MCPTool",
84-
session: "Optional[ClientSession]" = None,
85+
mcp_tool: MCPTool,
86+
session: Optional[ClientSession] = None,
8587
connection: Any = None,
86-
) -> "AgentTool":
88+
) -> AgentTool:
8789
"""
8890
Create an AgentTool from an MCPTool and a session or connection.
8991
@@ -157,10 +159,10 @@ async def executor(**kwargs: Any) -> Any:
157159
@classmethod
158160
def from_mcp_many(
159161
cls,
160-
mcp_tools: list,
161-
session: "ClientSession" = None,
162+
mcp_tools: list[MCPTool],
163+
session: Optional[ClientSession] = None,
162164
connection: Any = None,
163-
) -> list:
165+
) -> list[AgentTool]:
164166
"""
165167
Batch-create AgentTool objects from a list of MCPTool objects.
166168
@@ -182,7 +184,7 @@ def from_mcp_many(
182184
]
183185

184186
@classmethod
185-
async def from_mcp_session(cls, session: "ClientSession") -> list:
187+
async def from_mcp_session(cls, session: ClientSession) -> list[AgentTool]:
186188
"""
187189
Fetch all tools and wrap them as AgentTool objects.
188190
@@ -201,8 +203,8 @@ async def from_mcp_session(cls, session: "ClientSession") -> list:
201203
@classmethod
202204
def from_toolbox(
203205
cls,
204-
toolbox_tool: "ToolboxSyncTool",
205-
) -> "AgentTool":
206+
toolbox_tool: ToolboxSyncTool,
207+
) -> AgentTool:
206208
"""
207209
Create an AgentTool from a ToolboxSyncTool.
208210
@@ -275,8 +277,8 @@ def executor(**kwargs: Any) -> Any:
275277
@classmethod
276278
def from_toolbox_many(
277279
cls,
278-
toolbox_tools: list,
279-
) -> list:
280+
toolbox_tools: list[ToolboxSyncTool],
281+
) -> list[AgentTool]:
280282
"""
281283
Batch-create AgentTool objects from a list of ToolboxSyncTool objects.
282284

0 commit comments

Comments
 (0)