mirror of
https://github.com/ollama/ollama.git
synced 2025-11-11 14:17:11 +01:00
fix tests
This commit is contained in:
@@ -484,13 +484,7 @@ func TestChatMiddleware(t *testing.T) {
|
|||||||
Function: api.ToolFunction{
|
Function: api.ToolFunction{
|
||||||
Name: "get_weather",
|
Name: "get_weather",
|
||||||
Description: "Get the current weather",
|
Description: "Get the current weather",
|
||||||
Parameters: struct {
|
Parameters: api.ToolFunctionParameters{
|
||||||
Type string `json:"type"`
|
|
||||||
Defs any `json:"$defs,omitempty"`
|
|
||||||
Items any `json:"items,omitempty"`
|
|
||||||
Required []string `json:"required"`
|
|
||||||
Properties map[string]api.ToolProperty `json:"properties"`
|
|
||||||
}{
|
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"location"},
|
Required: []string{"location"},
|
||||||
Properties: map[string]api.ToolProperty{
|
Properties: map[string]api.ToolProperty{
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ func TestChatDebugRenderOnly(t *testing.T) {
|
|||||||
DebugRenderOnly: true,
|
DebugRenderOnly: true,
|
||||||
},
|
},
|
||||||
expectDebug: true,
|
expectDebug: true,
|
||||||
expectTemplate: "[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get weather information\",\"parameters\":{\"type\":\"\",\"required\":null,\"properties\":null}}}]user: Get the weather\n",
|
expectTemplate: "[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get weather information\",\"parameters\":{\"type\":\"\",\"properties\":null}}}]user: Get the weather\n",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -485,13 +485,7 @@ func TestGenerateChat(t *testing.T) {
|
|||||||
Function: api.ToolFunction{
|
Function: api.ToolFunction{
|
||||||
Name: "get_weather",
|
Name: "get_weather",
|
||||||
Description: "Get the current weather",
|
Description: "Get the current weather",
|
||||||
Parameters: struct {
|
Parameters: api.ToolFunctionParameters{
|
||||||
Type string `json:"type"`
|
|
||||||
Defs any `json:"$defs,omitempty"`
|
|
||||||
Items any `json:"items,omitempty"`
|
|
||||||
Required []string `json:"required"`
|
|
||||||
Properties map[string]api.ToolProperty `json:"properties"`
|
|
||||||
}{
|
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"location"},
|
Required: []string{"location"},
|
||||||
Properties: map[string]api.ToolProperty{
|
Properties: map[string]api.ToolProperty{
|
||||||
@@ -585,13 +579,7 @@ func TestGenerateChat(t *testing.T) {
|
|||||||
Function: api.ToolFunction{
|
Function: api.ToolFunction{
|
||||||
Name: "get_weather",
|
Name: "get_weather",
|
||||||
Description: "Get the current weather",
|
Description: "Get the current weather",
|
||||||
Parameters: struct {
|
Parameters: api.ToolFunctionParameters{
|
||||||
Type string `json:"type"`
|
|
||||||
Defs any `json:"$defs,omitempty"`
|
|
||||||
Items any `json:"items,omitempty"`
|
|
||||||
Required []string `json:"required"`
|
|
||||||
Properties map[string]api.ToolProperty `json:"properties"`
|
|
||||||
}{
|
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"location"},
|
Required: []string{"location"},
|
||||||
Properties: map[string]api.ToolProperty{
|
Properties: map[string]api.ToolProperty{
|
||||||
|
|||||||
@@ -26,13 +26,7 @@ func getTestTools() []api.Tool {
|
|||||||
Function: api.ToolFunction{
|
Function: api.ToolFunction{
|
||||||
Name: "get_weather",
|
Name: "get_weather",
|
||||||
Description: "Get the current weather in a given location",
|
Description: "Get the current weather in a given location",
|
||||||
Parameters: struct {
|
Parameters: api.ToolFunctionParameters{
|
||||||
Type string `json:"type"`
|
|
||||||
Defs any `json:"$defs,omitempty"`
|
|
||||||
Items any `json:"items,omitempty"`
|
|
||||||
Required []string `json:"required"`
|
|
||||||
Properties map[string]api.ToolProperty `json:"properties"`
|
|
||||||
}{
|
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"location"},
|
Required: []string{"location"},
|
||||||
Properties: map[string]api.ToolProperty{
|
Properties: map[string]api.ToolProperty{
|
||||||
@@ -49,13 +43,7 @@ func getTestTools() []api.Tool {
|
|||||||
Function: api.ToolFunction{
|
Function: api.ToolFunction{
|
||||||
Name: "calculate",
|
Name: "calculate",
|
||||||
Description: "Calculate a mathematical expression",
|
Description: "Calculate a mathematical expression",
|
||||||
Parameters: struct {
|
Parameters: api.ToolFunctionParameters{
|
||||||
Type string `json:"type"`
|
|
||||||
Defs any `json:"$defs,omitempty"`
|
|
||||||
Items any `json:"items,omitempty"`
|
|
||||||
Required []string `json:"required"`
|
|
||||||
Properties map[string]api.ToolProperty `json:"properties"`
|
|
||||||
}{
|
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"expression"},
|
Required: []string{"expression"},
|
||||||
Properties: map[string]api.ToolProperty{
|
Properties: map[string]api.ToolProperty{
|
||||||
|
|||||||
Reference in New Issue
Block a user