Java: fix javadoc in orchestration package (#5244)

Fixes #5219
This commit is contained in:
David Grieve
2024-03-01 11:08:41 -05:00
committed by GitHub
parent e9d76d5810
commit c3d4fea0ca
3 changed files with 73 additions and 10 deletions
@@ -1,6 +1,14 @@
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.microsoft.semantickernel.builders.SemanticKernelBuilder;
import com.microsoft.semantickernel.contextvariables.ContextVariableType;
import com.microsoft.semantickernel.hooks.KernelHooks;
@@ -16,13 +24,8 @@ import com.microsoft.semantickernel.services.AIServiceSelection;
import com.microsoft.semantickernel.services.AIServiceSelector;
import com.microsoft.semantickernel.services.OrderedAIServiceSelector;
import com.microsoft.semantickernel.services.ServiceNotFoundException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
/**
* Provides state for use throughout a Semantic Kernel workload.
@@ -276,6 +279,9 @@ public class Kernel {
@Nullable
private Function<AIServiceCollection, AIServiceSelector> serviceSelectorProvider;
/**
* Construct a Builder for creating a new instance of {@code Kernel}.
*/
public Builder() {
}
@@ -1,29 +1,81 @@
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.orchestration;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Configuration settings for prompt execution.
*/
public class PromptExecutionSettings {
/**
* The default for {@link #getServiceId()} if a
* {@link Builder#withServiceId(String) service id} is not provided.
* Defaults to {@code "default"}
*/
public static final String DEFAULT_SERVICE_ID = "default";
/**
* The default for {@link #getMaxTokens()} if
* {@link Builder#withMaxTokens(int) max_tokens} is not provided.
* Defaults to {@code 256}
*/
public static final Integer DEFAULT_MAX_TOKENS = 256;
/**
* The default for {@link #getTemperature()} if
* {@link Builder#withTemperature(double) temperature} is not provided.
* Defaults to {@code 1.0}
*/
public static final Double DEFAULT_TEMPERATURE = 1.0;
/**
* The default for {@link #getTopP()} if
* {@link Builder#withTopP(double) top_p} is not provided.
* Defaults to {@code 1.0}
*/
public static final Double DEFAULT_TOP_P = 1.0;
/**
* The default for {@link #getPresencePenalty()} if
* {@link Builder#withPresencePenalty(double) presence_penalty} is not provided.
* Defaults to {@code 0.0}
*/
public static final Double DEFAULT_PRESENCE_PENALTY = 0.0;
/**
* The default for {@link #getFrequencyPenalty()} if
* {@link Builder#withMaxTokens(doulbe) frequency_penalty} is not provided.
* Defaults to {@code 0.0}
*/
public static final Double DEFAULT_FREQUENCY_PENALTY = 0.0;
/**
* The default for {@link #getBestOf()} if
* {@link Builder#withBestOf(int) best_of} is not provided.
* Defaults to {@code 1}
*/
public static final Integer DEFAULT_BEST_OF = 1;
/**
* The default for {@link #getResultsPerPrompt()} if
* {@link Builder#withResultsPerPrompt(int) results per prompt (n)} is not provided.
* Defaults to {@code 1}
*/
public static final Integer DEFAULT_RESULTS_PER_PROMPT = 1;
//
// Keys used as both @JsonProperty names and keys to the Builder's value map.
//
private static final String SERVICE_ID = "service_id";
private static final String MODEL_ID = "model_id";
private static final String TEMPERATURE = "temperature";
@@ -1,15 +1,16 @@
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.orchestration;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import javax.annotation.Nullable;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
/**
* Defines the behavior of a tool call. Currently, the only tool available is function calling.
*/
@@ -131,6 +132,10 @@ public class ToolCallBehavior {
this.requiredFunction = requiredFunction;
}
/**
* Get the required function.
* @return the required function.
*/
public KernelFunction<?> getRequiredFunction() {
return requiredFunction;
}