From 9a3d7fa33cdb2b33f1c336fe23f5e834fc95ec67 Mon Sep 17 00:00:00 2001 From: Dinesh Yeduguru Date: Mon, 30 Dec 2024 13:03:39 -0800 Subject: [PATCH] rebase fixes --- llama_stack/apis/agents/agents.py | 5 +++-- llama_stack/distribution/datatypes.py | 2 +- llama_stack/distribution/routers/routing_tables.py | 4 ++++ .../inline/agents/meta_reference/agent_instance.py | 10 ++++------ llama_stack/providers/tests/tools/fixtures.py | 2 +- llama_stack/providers/tests/tools/test_tools.py | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/llama_stack/apis/agents/agents.py b/llama_stack/apis/agents/agents.py index 88ae91906..75f1cb9c0 100644 --- a/llama_stack/apis/agents/agents.py +++ b/llama_stack/apis/agents/agents.py @@ -14,15 +14,15 @@ from typing import ( Literal, Optional, Protocol, - Union, runtime_checkable, + Union, ) from llama_models.schema_utils import json_schema_type, webmethod from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated -from llama_stack.apis.common.content_types import URL, InterleavedContent +from llama_stack.apis.common.content_types import InterleavedContent, URL from llama_stack.apis.inference import ( CompletionMessage, SamplingParams, @@ -36,6 +36,7 @@ from llama_stack.apis.inference import ( ) from llama_stack.apis.memory import MemoryBank from llama_stack.apis.safety import SafetyViolation +from llama_stack.apis.tools import CustomToolDef from llama_stack.providers.utils.telemetry.trace_protocol import trace_protocol diff --git a/llama_stack/distribution/datatypes.py b/llama_stack/distribution/datatypes.py index ba7ba62bd..d0ccd6cd1 100644 --- a/llama_stack/distribution/datatypes.py +++ b/llama_stack/distribution/datatypes.py @@ -20,7 +20,7 @@ from llama_stack.apis.safety import Safety from llama_stack.apis.scoring import Scoring from llama_stack.apis.scoring_functions import ScoringFn, ScoringFnInput from llama_stack.apis.shields import Shield, ShieldInput -from llama_stack.apis.tools import Tool, ToolGroup, ToolRuntime +from llama_stack.apis.tools import Tool, ToolGroup, ToolGroupInput, ToolRuntime from llama_stack.providers.datatypes import Api, ProviderSpec from llama_stack.providers.utils.kvstore.config import KVStoreConfig diff --git a/llama_stack/distribution/routers/routing_tables.py b/llama_stack/distribution/routers/routing_tables.py index 45708649b..f0d55eaf2 100644 --- a/llama_stack/distribution/routers/routing_tables.py +++ b/llama_stack/distribution/routers/routing_tables.py @@ -27,11 +27,15 @@ from llama_stack.apis.scoring_functions import ( ) from llama_stack.apis.shields import Shield, Shields from llama_stack.apis.tools import ( + BuiltInToolDef, + CustomToolDef, MCPToolGroupDef, Tool, ToolGroup, ToolGroupDef, ToolGroups, + ToolHost, + ToolPromptFormat, UserDefinedToolGroupDef, ) from llama_stack.distribution.datatypes import ( diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index 6cf031bf7..219afe621 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -13,11 +13,11 @@ import secrets import string import uuid from datetime import datetime -from typing import AsyncGenerator, List +from typing import AsyncGenerator, List, Optional from urllib.parse import urlparse import httpx -from llama_models.llama3.api.datatypes import BuiltinTool +from llama_models.llama3.api.datatypes import BuiltinTool, ToolCall, ToolParamDefinition from llama_stack.apis.agents import ( AgentConfig, @@ -37,10 +37,7 @@ from llama_stack.apis.agents import ( ToolExecutionStep, Turn, ) -from llama_stack.apis.common.content_types import ( - URL, - TextContentItem, -) +from llama_stack.apis.common.content_types import TextContentItem, URL from llama_stack.apis.inference import ( ChatCompletionResponseEventType, CompletionMessage, @@ -59,6 +56,7 @@ from llama_stack.apis.inference import ( from llama_stack.apis.memory import Memory from llama_stack.apis.memory_banks import MemoryBanks from llama_stack.apis.safety import Safety +from llama_stack.apis.tools import ToolGroups, ToolRuntime from llama_stack.providers.utils.kvstore import KVStore from llama_stack.providers.utils.telemetry import tracing diff --git a/llama_stack/providers/tests/tools/fixtures.py b/llama_stack/providers/tests/tools/fixtures.py index 845e0dba4..5493a4987 100644 --- a/llama_stack/providers/tests/tools/fixtures.py +++ b/llama_stack/providers/tests/tools/fixtures.py @@ -8,6 +8,7 @@ import os import pytest import pytest_asyncio +from llama_models.llama3.api.datatypes import BuiltinTool from llama_stack.apis.models import ModelInput, ModelType from llama_stack.apis.tools import ( @@ -17,7 +18,6 @@ from llama_stack.apis.tools import ( ToolParameter, UserDefinedToolGroupDef, ) -from llama_stack.apis.tools.tools import BuiltinTool from llama_stack.distribution.datatypes import Api, Provider from llama_stack.providers.tests.resolver import construct_stack_for_test diff --git a/llama_stack/providers/tests/tools/test_tools.py b/llama_stack/providers/tests/tools/test_tools.py index 08c7afe1e..7e4947cb7 100644 --- a/llama_stack/providers/tests/tools/test_tools.py +++ b/llama_stack/providers/tests/tools/test_tools.py @@ -14,7 +14,7 @@ from llama_stack.apis.memory_banks import VectorMemoryBankParams from llama_stack.apis.tools import ToolInvocationResult from llama_stack.providers.datatypes import Api -from .fixtures import tool_runtime_memory_and_search # noqa: F401 +from .fixtures import tools_stack as _tools_stack # noqa: F401, F811 @pytest.fixture