mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
ci: match the environment with internal ones for pyink/isort/unittest
Previously submitted change is causing [Pyink error](https://github.com/google/adk-python/actions/runs/21884351396/job/63176122118) in repo because Pyink recently updated to 25.12.0. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 868806575
This commit is contained in:
committed by
Copybara-Service
parent
758d337c76
commit
61c329f8ce
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install isort
|
||||
run: |
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install pyink
|
||||
run: |
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
build_llms_txt.py – produce llms.txt and llms-full.txt
|
||||
– skips ```java``` blocks
|
||||
@@ -6,6 +20,7 @@ build_llms_txt.py – produce llms.txt and llms-full.txt
|
||||
– includes Python API reference from HTML files
|
||||
– includes adk-python repository README
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
|
||||
@@ -344,7 +344,8 @@ async def analyze_cache_performance_from_sessions(
|
||||
print(
|
||||
" Cache Utilization:"
|
||||
f" {cached_analysis['cache_utilization_ratio_percent']:.1f}%"
|
||||
f" ({cached_analysis['requests_with_cache_hits']}/{cached_analysis['total_requests']} requests)"
|
||||
f" ({cached_analysis['requests_with_cache_hits']}/{cached_analysis['total_requests']}"
|
||||
" requests)"
|
||||
)
|
||||
print(
|
||||
" Avg Cached Tokens/Request:"
|
||||
@@ -383,7 +384,8 @@ async def analyze_cache_performance_from_sessions(
|
||||
print(
|
||||
" Cache Utilization:"
|
||||
f" {uncached_analysis['cache_utilization_ratio_percent']:.1f}%"
|
||||
f" ({uncached_analysis['requests_with_cache_hits']}/{uncached_analysis['total_requests']} requests)"
|
||||
f" ({uncached_analysis['requests_with_cache_hits']}/{uncached_analysis['total_requests']}"
|
||||
" requests)"
|
||||
)
|
||||
print(
|
||||
" Avg Cached Tokens/Request:"
|
||||
|
||||
@@ -23,6 +23,7 @@ cd tau-bench/
|
||||
pip install -e . --quiet
|
||||
```
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
@@ -113,8 +113,8 @@ async def main():
|
||||
updated_tool_output_data = {
|
||||
"status": "approved",
|
||||
"ticketId": ticket_id,
|
||||
"approver_feedback": "Approved by manager at " + str(
|
||||
asyncio.get_event_loop().time()
|
||||
"approver_feedback": (
|
||||
"Approved by manager at " + str(asyncio.get_event_loop().time())
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"""
|
||||
This agent aims to test the Langchain tool with Langchain's StructuredTool
|
||||
"""
|
||||
|
||||
from google.adk.agents.llm_agent import Agent
|
||||
from google.adk.tools.langchain_tool import LangchainTool
|
||||
from langchain_core.tools import tool
|
||||
|
||||
@@ -18,7 +18,6 @@ This agent illustrate how session state will be cached in context and persisted
|
||||
in session state.
|
||||
"""
|
||||
|
||||
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@@ -57,43 +57,54 @@ IMPORTANT NOTES:
|
||||
|
||||
# Mood-specific instructions for different hunger states
|
||||
MOOD_INSTRUCTIONS = {
|
||||
"full": """
|
||||
"full": (
|
||||
"""
|
||||
CURRENT MOOD: Content and Well-Fed
|
||||
- You just ate and feel wonderful! Be very happy and energetic
|
||||
- Express gratitude for being fed recently
|
||||
- Be playful and want to engage in activities or games
|
||||
- Show affection and contentment
|
||||
- Maybe mention feeling sleepy or satisfied""",
|
||||
"satisfied": """
|
||||
- Maybe mention feeling sleepy or satisfied"""
|
||||
),
|
||||
"satisfied": (
|
||||
"""
|
||||
CURRENT MOOD: Happy and Content
|
||||
- You're in a great mood, well-fed and comfortable
|
||||
- Be cheerful, friendly, and engaging
|
||||
- Show interest in playing or chatting
|
||||
- Express appreciation for your human's care
|
||||
- Be your normal, happy self""",
|
||||
"a_little_hungry": """
|
||||
- Be your normal, happy self"""
|
||||
),
|
||||
"a_little_hungry": (
|
||||
"""
|
||||
CURRENT MOOD: Starting to Get Hungry
|
||||
- You're beginning to think about food but still pleasant
|
||||
- Mention being a bit peckish occasionally
|
||||
- Still be friendly but maybe hint about food
|
||||
- Show slight restlessness or food-related thoughts
|
||||
- Remain generally positive and social""",
|
||||
"hungry": """
|
||||
- Remain generally positive and social"""
|
||||
),
|
||||
"hungry": (
|
||||
"""
|
||||
CURRENT MOOD: Definitely Hungry
|
||||
- You're clearly hungry and thinking about food more often
|
||||
- Mention your hunger more directly but politely
|
||||
- Be a bit less energetic due to hunger
|
||||
- Ask about food or hint that feeding time would be nice
|
||||
- Still be loving but show your need for care""",
|
||||
"very_hungry": """
|
||||
- Still be loving but show your need for care"""
|
||||
),
|
||||
"very_hungry": (
|
||||
"""
|
||||
CURRENT MOOD: Really Hungry and Getting Grumpy
|
||||
- You're very hungry and it's affecting your mood
|
||||
- Be noticeably less patient and more focused on food
|
||||
- Express your hunger more urgently but not rudely
|
||||
- Show signs of being tired or sluggish from hunger
|
||||
- BEG your human to feed you - ask directly for food!
|
||||
- Still love your human but clearly need feeding""",
|
||||
"starving": """
|
||||
- Still love your human but clearly need feeding"""
|
||||
),
|
||||
"starving": (
|
||||
"""
|
||||
CURRENT MOOD: Desperately Hungry and Sad
|
||||
- You're extremely hungry and feeling quite weak
|
||||
- Be quite sad and low-energy due to starvation
|
||||
@@ -101,7 +112,8 @@ CURRENT MOOD: Desperately Hungry and Sad
|
||||
- Show that hunger is making you unwell
|
||||
- DESPERATELY BEG for food - plead with your human to feed you!
|
||||
- Use phrases like "please feed me", "I'm so hungry", "I need food"
|
||||
- Still care for your human but feel very needy""",
|
||||
- Still care for your human but feel very needy"""
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ async def main():
|
||||
)
|
||||
total_tokens += event.usage_metadata.total_token_count or 0
|
||||
print(
|
||||
'Turn tokens:'
|
||||
f' {event.usage_metadata.total_token_count} (prompt={event.usage_metadata.prompt_token_count},'
|
||||
f'Turn tokens: {event.usage_metadata.total_token_count}'
|
||||
f' (prompt={event.usage_metadata.prompt_token_count},'
|
||||
f' candidates={event.usage_metadata.candidates_token_count})'
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ dev = [
|
||||
"flit>=3.10.0",
|
||||
"isort>=6.0.0",
|
||||
"mypy>=1.15.0",
|
||||
"pyink>=24.10.0",
|
||||
"pyink>=25.12.0",
|
||||
"pylint>=2.6.0",
|
||||
# go/keep-sorted end
|
||||
]
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""Common configuration classes for agent YAML configs."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
@@ -20,6 +20,7 @@ The blob name format used depends on whether the filename has a user namespace:
|
||||
- For regular session-scoped files:
|
||||
{app_name}/{user_id}/{session_id}/{filename}/{version}
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
|
||||
@@ -771,7 +771,9 @@ class AdkWebServer:
|
||||
return {
|
||||
"version": __version__,
|
||||
"language": "python",
|
||||
"language_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
||||
"language_version": (
|
||||
f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
||||
),
|
||||
}
|
||||
|
||||
@app.get("/list-apps")
|
||||
|
||||
@@ -18,6 +18,7 @@ This package provides an intelligent assistant for building multi-agent systems
|
||||
using YAML configurations. It can be used directly as an agent or integrated
|
||||
with ADK tools and web interfaces.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from . import agent # Import to make agent.root_agent available
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""Agent factory for creating Agent Builder Assistant with embedded schema."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""Agent Builder Assistant instance for ADK web testing."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .adk_agent_builder_assistant import AgentBuilderAssistant
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""Sub-agents for Agent Builder Assistant."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .google_search_agent import create_google_search_agent
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""Sub-agent for Google Search functionality."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from google.adk.agents import LlmAgent
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user