Skip to content

A semantic kernal function with a nullable number parameter cannot be handled by ollamasharp #296

@jdamen

Description

@jdamen

A semantic kernal function with a nullable number parameter cannot be handled by ollamasharp. Please fix

[KernelFunction, Description("Creates a taskboard task with the provided information."]
[return: Description("The created or updated task board task details.")]
public async Task<TaskBoardTaskModel> SaveTaskBoardTaskAsync(
    [Description("The unique identifier of the task board where the task should be created or " + Prompts.UniqueIdenifierWithFormat)]
    string taskBoardUniqueIdentifier,
    [Description("The name of the task")]
    string name,
    [Description("The description of the task.")]
    string description,
    [Description("Optional delivery date. Format (YYYY-MM-dd)")]
    string deliveryDate = null,
    [Description("Optional estimated effect in user store point.")]
    **double? effort = null,**
    [Description("Optional color. expressed in hexidicimal RGB value (#FFFFFF for white..).")]
    string color = null)
{
...
}

json generated by semantic kernel AI

{
"type": "object",
"condition": "Creates a taskboard task with the provided information.",
"properties": {
"taskBoardUniqueIdentifier": {
"description": "The unique identifier of the task board where the task should be created or unique identifier (format: DWM-{0:D}-number)",
"type": "string"
},
"name": {
"description": "The name of the task",
"type": "string"
},
"description": {
"description": "The description of the task.",
"type": "string"
},
"deliveryDate": {
"description": "Optional delivery date. Format (YYYY-MM-dd)",
"type": "string"
},
"effort": {
"description": "Optional estimated effect in user store point.",
"type": [
"number",
"null"
]

},
"color": {
"description": "Optional color. expressed in hexidicimal RGB value (#FFFFFF for white..).",
"type": "string"
}
},
"required": [
"taskBoardUniqueIdentifier",
"name",
"description"
],
"additionalProperties": false
}

look at the effort property. OllamaSharp expect a string, while MS AI generates an array

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions