File size: 947 Bytes
4304c6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from typing import Any, Optional

from pydantic import BaseModel

from core.tools.entities.tool_entities import ToolParameter, ToolProviderType


class ApiBasedToolBundle(BaseModel):
    """

    This class is used to store the schema information of an api based tool. such as the url, the method, the parameters, etc.

    """
    # server_url
    server_url: str
    # method
    method: str
    # summary
    summary: Optional[str] = None
    # operation_id
    operation_id: str = None
    # parameters
    parameters: Optional[list[ToolParameter]] = None
    # author
    author: str
    # icon
    icon: Optional[str] = None
    # openapi operation
    openapi: dict

class AppToolBundle(BaseModel):
    """

    This class is used to store the schema information of an tool for an app.

    """
    type: ToolProviderType
    credential: Optional[dict[str, Any]] = None
    provider_id: str
    tool_name: str