Skip to content

Why toolCallArguments cannot be null or empty? #3234

@lanyuanxiaoyao

Description

@lanyuanxiaoyao

Bug description
A simple toolcalling for asking current datetime, but i receive toolCallArguments cannot be null or empty

Environment
1.0.0-RC1
spring-ai-starter-model-openai

Steps to reproduce

@Slf4j
public class DatetimeTools {
  private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

  @Tool(description = "Query current date and time")
  public String getCurrentDatetime() {
    String currentDatetime = LocalDateTime.now().format(formatter);
    return currentDatetime;
  }
}
client.prompt()
        .user("What time is it now? ")
        .tools(new DatetimeTools())
        .stream()
        .content()
        .subscribe(log::info);

Expected behavior
It's ok when i use sync calling, but fail on stream calling. Anything i missed?

Minimal Complete Reproducible example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions