Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import com.microsoft.semantickernel.plugin.KernelPlugin;
import com.microsoft.semantickernel.semanticfunctions.InputVariable;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.services.chatcompletion.AuthorRole;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;
import com.microsoft.semantickernel.services.chatcompletion.ChatHistory;
Expand Down Expand Up @@ -436,7 +436,7 @@ public Mono<GeminiFunctionCall> performFunctionCall(@Nullable Kernel kernel,
? new ContextVariableTypes()
: invocationContext.getContextVariableTypes();

KernelFunctionArguments.Builder arguments = KernelFunctionArguments.builder();
KernelArguments.Builder arguments = KernelArguments.builder();
geminiFunction.getFunctionCall().getArgs().getFieldsMap().forEach((key, value) -> {
arguments.withVariable(key, value.getStringValue());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import com.microsoft.semantickernel.orchestration.responseformat.JsonResponseSchema;
import com.microsoft.semantickernel.orchestration.responseformat.JsonSchemaResponseFormat;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.services.chatcompletion.AuthorRole;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;
import com.microsoft.semantickernel.services.chatcompletion.ChatHistory;
Expand Down Expand Up @@ -629,7 +629,7 @@ private Mono<FunctionResult<String>> invokeFunctionTool(
contextVariableTypes));

function = hookResult.getFunction();
KernelFunctionArguments arguments = hookResult.getArguments();
KernelArguments arguments = hookResult.getArguments();

return function
.invokeAsync(kernel)
Expand Down Expand Up @@ -673,7 +673,7 @@ private OpenAIFunctionToolCall extractOpenAIFunctionToolCall(
String pluginName = parts.length > 1 ? parts[0] : "";
String fnName = parts.length > 1 ? parts[1] : parts[0];

KernelFunctionArguments arguments = KernelFunctionArguments.builder().build();
KernelArguments arguments = KernelArguments.builder().build();

ObjectMapper mapper = new ObjectMapper();
JsonNode jsonToolCallArguments = mapper.readTree(toolCall.getFunction().getArguments());
Expand Down Expand Up @@ -1144,7 +1144,7 @@ private static ChatRequestAssistantMessage formAssistantMessage(
asstMessage.setToolCalls(
toolCalls.stream()
.map(toolCall -> {
KernelFunctionArguments arguments = toolCall.getArguments();
KernelArguments arguments = toolCall.getArguments();

String args = arguments != null && !arguments.isEmpty()
? arguments.entrySet().stream()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.aiservices.openai.chatcompletion;

import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import javax.annotation.Nullable;

/**
Expand All @@ -23,7 +23,7 @@ public class OpenAIFunctionToolCall {

/// <summary>Gets a name/value collection of the arguments to the function, if any.</summary>
@Nullable
private final KernelFunctionArguments arguments;
private final KernelArguments arguments;

/**
* Creates a new instance of the {@link OpenAIFunctionToolCall} class.
Expand All @@ -37,7 +37,7 @@ public OpenAIFunctionToolCall(
@Nullable String id,
@Nullable String pluginName,
String functionName,
@Nullable KernelFunctionArguments arguments) {
@Nullable KernelArguments arguments) {
this.id = id;
this.pluginName = pluginName;
this.functionName = functionName;
Expand Down Expand Up @@ -83,7 +83,7 @@ public String getFunctionName() {
* @return A name/value collection of the arguments to the function, if any.
*/
@Nullable
public KernelFunctionArguments getArguments() {
public KernelArguments getArguments() {
if (arguments == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.azure.json.implementation.DefaultJsonReader;
import com.microsoft.semantickernel.implementation.EmbeddedResourceLoader;
import com.microsoft.semantickernel.orchestration.FunctionResultMetadata;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.services.chatcompletion.AuthorRole;
import com.microsoft.semantickernel.services.chatcompletion.ChatHistory;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -46,7 +46,7 @@ public void serializesToolCallsCorrectly() {
"a-tool-id",
"pluginName",
"funcName",
KernelFunctionArguments.builder()
KernelArguments.builder()
.withVariable("id", "ca2fc6bc-1307-4da6-a009-d7bf88dec37b")
.build()))));
chatHistory.addMessage(new OpenAIChatMessageContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.microsoft.semantickernel.plugin.KernelPlugin;
import com.microsoft.semantickernel.plugin.KernelPluginFactory;
import com.microsoft.semantickernel.samples.syntaxexamples.functions.Example03_Arguments.StaticTextPlugin;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

Expand All @@ -24,7 +24,7 @@ public void main() {
KernelPlugin functionCollection = KernelPluginFactory
.createFromObject(new StaticTextPlugin(), "text");

KernelFunctionArguments arguments = KernelFunctionArguments.builder()
KernelArguments arguments = KernelArguments.builder()
.withInput("Today is: ")
.withVariable("day", "Monday")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import com.microsoft.semantickernel.orchestration.FunctionResult;
import com.microsoft.semantickernel.orchestration.PromptExecutionSettings;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt;
import com.microsoft.semantickernel.services.textcompletion.TextGenerationService;

import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
Expand Down Expand Up @@ -68,7 +68,7 @@ public void main(WireMockRuntimeInfo wmRuntimeInfo) {

var result = kernel.invokeAsync(excuseFunction)
.withArguments(
KernelFunctionArguments.builder()
KernelArguments.builder()
.withInput("I missed the F1 final race")
.build())
.block();
Expand All @@ -79,7 +79,7 @@ public void main(WireMockRuntimeInfo wmRuntimeInfo) {

result = kernel.invokeAsync(excuseFunction)
.withArguments(
KernelFunctionArguments.builder()
KernelArguments.builder()
.withInput("sorry I forgot your birthday")
.build())
.block();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.microsoft.semantickernel.hooks.KernelHook.FunctionInvokingHook;
import com.microsoft.semantickernel.orchestration.PromptExecutionSettings;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt;
import com.microsoft.semantickernel.semanticfunctions.OutputVariable;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;
Expand Down Expand Up @@ -90,7 +90,7 @@ public void getUsageAsync(WireMockRuntimeInfo wmRuntimeInfo) {
kernel.invokeAsync(
excuseFunction)
.withArguments(
KernelFunctionArguments
KernelArguments
.builder()
.withVariable("input", "I missed the F1 final race")
.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.microsoft.semantickernel.aiservices.openai.textcompletion.OpenAITextGenerationService;
import com.microsoft.semantickernel.plugin.KernelPluginFactory;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.PromptTemplateConfig;
import com.microsoft.semantickernel.semanticfunctions.annotations.DefineKernelFunction;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;
Expand Down Expand Up @@ -49,7 +49,7 @@ public void textSemanticKernelTemplateXml() {
""")
.withTemplateFormat(PromptTemplateConfig.SEMANTIC_KERNEL_TEMPLATE_FORMAT)
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "<message role=\"user\">\"hello world\"</message>")
.build())
Expand All @@ -71,7 +71,7 @@ public void textSemanticKernelTemplate() {
""")
.withTemplateFormat(PromptTemplateConfig.SEMANTIC_KERNEL_TEMPLATE_FORMAT)
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "{{$ignore}}")
.withVariable("ignore", "dont show")
Expand All @@ -94,7 +94,7 @@ public void textHandleBarsTemplate() {
""")
.withTemplateFormat("handlebars")
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "{{ignore}}")
.withVariable("ignore", "dont show")
Expand All @@ -117,7 +117,7 @@ public void chatSemanticKernelTemplateXml() {
""")
.withTemplateFormat(PromptTemplateConfig.SEMANTIC_KERNEL_TEMPLATE_FORMAT)
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "<message role=\"user\">\"hello world\"</message>")
.build())
Expand All @@ -139,7 +139,7 @@ public void chatSemanticKernelTemplate() {
""")
.withTemplateFormat(PromptTemplateConfig.SEMANTIC_KERNEL_TEMPLATE_FORMAT)
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "{{$ignore}}")
.withVariable("ignore", "dont show")
Expand All @@ -162,7 +162,7 @@ public void chatHandleBarsTemplate() {
""")
.withTemplateFormat("handlebars")
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "{{ignore}}")
.withVariable("ignore", "dont show")
Expand All @@ -185,7 +185,7 @@ public void chatSemanticKernelTemplate2() {
""")
.withTemplateFormat(PromptTemplateConfig.SEMANTIC_KERNEL_TEMPLATE_FORMAT)
.build())
.withArguments(KernelFunctionArguments
.withArguments(KernelArguments
.builder()
.withVariable("value", "{{$ignore}}")
.withVariable("ignore", "dont show")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.microsoft.semantickernel.contextvariables.ContextVariableTypes;
import com.microsoft.semantickernel.orchestration.PromptExecutionSettings;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.annotations.DefineKernelFunction;
import com.microsoft.semantickernel.semanticfunctions.annotations.KernelFunctionParameter;
import com.microsoft.semantickernel.text.TextChunker;
Expand Down Expand Up @@ -71,7 +71,7 @@ private static Mono<String> processAsync(KernelFunction<String> func, String inp
// The first parameter is the input text.
return func.invokeAsync(kernel)
.withArguments(
new KernelFunctionArguments.Builder()
KernelArguments.builder()
.withInput(paragraph)
.build())
.withResultType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.microsoft.semantickernel.Kernel;
import com.microsoft.semantickernel.plugin.KernelPluginFactory;
import com.microsoft.semantickernel.samples.plugins.web.SearchUrlPlugin;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;

public class Example11_WebSearchQueries {

Expand All @@ -19,7 +19,7 @@ public static void main(String[] args) {

// Run
var ask = "What's the largest building in Europe?";
var kernelArguments = KernelFunctionArguments.builder()
var kernelArguments = KernelArguments.builder()
.withVariable("query", ask)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.microsoft.semantickernel.Kernel;
import com.microsoft.semantickernel.aiservices.huggingface.HuggingFaceClient;
import com.microsoft.semantickernel.aiservices.huggingface.services.HuggingFaceTextGenerationService;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt;
import com.microsoft.semantickernel.services.textcompletion.TextGenerationService;

Expand Down Expand Up @@ -43,7 +43,7 @@ public static void runInferenceApiExampleAsync() {

var result = kernel.invokeAsync(questionAnswerFunction)
.withArguments(
KernelFunctionArguments.builder()
KernelArguments.builder()
.withVariable("input", "What is New York?")
.build())
.withResultType(String.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.microsoft.semantickernel.aiservices.openai.chatcompletion.OpenAIChatCompletion;
import com.microsoft.semantickernel.orchestration.FunctionResult;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;

Expand Down Expand Up @@ -61,7 +61,7 @@ public static void main(String[] args) {
FunctionResult<String> result = kernel.invokeAsync(
myFunction)
.withArguments(
KernelFunctionArguments.builder()
KernelArguments.builder()
.withVariable("input", "travel")
.build())
.block();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.microsoft.semantickernel.hooks.PromptRenderedEvent;
import com.microsoft.semantickernel.orchestration.FunctionResult;
import com.microsoft.semantickernel.orchestration.PromptExecutionSettings;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt;
import com.microsoft.semantickernel.semanticfunctions.OutputVariable;
import com.microsoft.semantickernel.services.chatcompletion.ChatCompletionService;
Expand Down Expand Up @@ -133,7 +133,7 @@ private static void getUsageAsync(Kernel kernel) {
String input = "I missed the F1 final race";
var result = kernel.invokeAsync(excuseFunction)
.withArguments(
KernelFunctionArguments
KernelArguments
.builder()
.withVariable("input", input)
.build())
Expand Down Expand Up @@ -189,7 +189,7 @@ private static void getRenderedPromptAsync(Kernel kernel) {
String input = "I missed the F1 final race";
var result = kernel.invokeAsync(excuseFunction)
.withArguments(
KernelFunctionArguments
KernelArguments
.builder()
.withVariable("input", input)
.build())
Expand Down Expand Up @@ -235,7 +235,7 @@ private static void changingResultAsync(Kernel kernel) {
// Invoke prompt to trigger execution hooks.
var result = kernel.invokeAsync(writerFunction)
.withArguments(
KernelFunctionArguments.builder().build())
KernelArguments.builder().build())
.block();
System.out.println("Function Result: " + result.getResult());
}
Expand Down Expand Up @@ -275,7 +275,7 @@ private static void beforeInvokeCancellationAsync(Kernel kernel) {
// Invoke prompt to trigger execution hooks.
var result = kernel.invokeAsync(writerFunction)
.withArguments(
KernelFunctionArguments.builder().build())
KernelArguments.builder().build())
.block();
System.out.println("Function Result: " + result.getResult());
} catch (Exception e) {
Expand Down Expand Up @@ -312,7 +312,7 @@ private static void afterInvokeCancellationAsync(Kernel kernel) {
// Invoke prompt to trigger execution hooks.
try {
var result = kernel.invokeAsync(secondFunction)
.withArguments(KernelFunctionArguments.builder().build())
.withArguments(KernelArguments.builder().build())
.block();
System.out.println("Function Result: " + result.getResult());
} catch (Exception e) {
Expand Down Expand Up @@ -359,7 +359,7 @@ private static void chatCompletionHook(Kernel kernel) {
// Invoke prompt to trigger execution hooks.
var result = kernel.invokeAsync(writerFunction)
.withArguments(
KernelFunctionArguments.builder().build())
KernelArguments.builder().build())
.block();
System.out.println("Function Result: " + result.getResult());
} catch (Exception e) {
Expand Down Expand Up @@ -403,7 +403,7 @@ private static void invocationHook(Kernel kernel) {
try {
// Invoke prompt to trigger execution hooks.
var result = kernel.invokeAsync(writerFunction)
.withArguments(KernelFunctionArguments.builder().build())
.withArguments(KernelArguments.builder().build())
.addKernelHooks(kernelHooks)
.block();
System.out.println("Function Result: " + result.getResult());
Expand Down
Loading