Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
lalala123123 committed Apr 25, 2024
1 parent 07adbac commit f74000c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ inputs:
is_chat_history: true
type: list
default: [
{
"role": "user",
"content": "what is the result of 1+1?"
},
{
"role": "Assistant",
"content": "The result of 1+1 is 2. It's a simple addition!"
},
{
"role": "user",
"content": "what is the result of 2+2?"
},
{
"role": "Assistant",
"content": "The result of 2+2 is 4. It's a simple addition!"
}
]
---
system:
Expand Down
75 changes: 18 additions & 57 deletions src/promptflow/tests/test_configs/tools/python_tool.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,23 @@
from promptflow.core import ToolProvider, tool
from promptflow.entities import InputSetting
from promptflow.connections import AzureOpenAIConnection

groups = [{
"name": "Tools",
"description": "Configure interactive capabilities by selecting tools for the model to use and guiding its tool call decisions.",
"inputs": ["tools", "tool_choice"],
"ui_hints": {"display_style": "table"}
}]
input_settings = InputSetting(
filter_by={
"input_name": "connection",
"filter_attribute": "type",
"values": {
"AzureOpenAIConnection": {
"enum": [
"chat",
"completion"
]
},
"OpenAIConnection": {
"enum": [
"chat",
"completion"
]
},
"ServerlessConnection": {
"enum": [
"chat"
]
}
}
}
)


@tool(
name="python_tool",
groups=groups,
input_settings={
"input1": input_settings
}
)

@tool(name="python_tool")
def my_python_tool(input1: str) -> str:
return 'hello ' + input1
#
#
# @tool
# def my_python_tool_without_name(input1: str) -> str:
# return 'hello ' + input1
#
#
# class PythonTool(ToolProvider):
#
# def __init__(self, connection: AzureOpenAIConnection):
# super().__init__()
# self.connection = connection
#
# @tool
# def python_tool(self, input1: str) -> str:
# return 'hello ' + input1


@tool
def my_python_tool_without_name(input1: str) -> str:
return 'hello ' + input1


class PythonTool(ToolProvider):

def __init__(self, connection: AzureOpenAIConnection):
super().__init__()
self.connection = connection

@tool
def python_tool(self, input1: str) -> str:
return 'hello ' + input1

0 comments on commit f74000c

Please sign in to comment.