-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python ToolCall新增函数、注解解析 #589
Conversation
|
||
# Update parameter view lists for function_parameter decorator. | ||
# This will be merged into ManifestView if function decorator runs last like: | ||
# @function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manifest
@manifest_parameter
@manifest_parameter
python/core/manifest/models.py
Outdated
|
||
from appbuilder.core.manifest.validate import validate_function_param_name, validate_function_name | ||
|
||
class BaseModel(DataClassJsonMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no BaseModel is appbuilder sdk now, remove it. If we were to define a BaseModel, it would be it core, not core/manifest
python/core/manifest/models.py
Outdated
description: str = None | ||
default_value: str = None | ||
type_: str = None | ||
type_object: Optional[Any] = Field(default=None, metadata = config(exclude=lambda value: True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove type_object
msg = client.run( | ||
conversation_id=conversation_id, | ||
query="今天北京的天气怎么样?", | ||
tools = [appbuilder.function_to_manifest(f).model_dump() for f in functions] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools = [Manifest.from(f) for f in functions]
python/core/manifest/manifest.py
Outdated
from appbuilder.core.manifest.manifest_signature import get_signature | ||
from appbuilder.core.manifest.manifest_decorator import ManifestView | ||
|
||
def function_to_manifest(func) -> Manifest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to Manifest class
d728fb3
to
09c55ff
Compare
更新tool call简化,添加了BaseModel,参数类型/注释缺失验证、参数描述提取,优先级等功能,补充了相关单测