Package org.apache.flink.model.openai
Class OpenAIChatModelFunction
- java.lang.Object
-
- org.apache.flink.table.functions.UserDefinedFunction
-
- org.apache.flink.table.functions.AsyncTableFunction<org.apache.flink.table.data.RowData>
-
- org.apache.flink.table.functions.AsyncPredictFunction
-
- org.apache.flink.model.openai.AbstractOpenAIModelFunction
-
- org.apache.flink.model.openai.OpenAIChatModelFunction
-
- All Implemented Interfaces:
Serializable,org.apache.flink.table.functions.FunctionDefinition
public class OpenAIChatModelFunction extends AbstractOpenAIModelFunction
AsyncPredictFunctionfor OpenAI chat completion task.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenAIChatModelFunction.ChatModelResponseFormatThe response format for Chat model function.-
Nested classes/interfaces inherited from class org.apache.flink.model.openai.AbstractOpenAIModelFunction
AbstractOpenAIModelFunction.ErrorHandlingStrategy, AbstractOpenAIModelFunction.ErrorMessageMetadata, AbstractOpenAIModelFunction.RetryFallbackStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static StringENDPOINT_SUFFIXstatic StringSTOP_SEPARATOR-
Fields inherited from class org.apache.flink.model.openai.AbstractOpenAIModelFunction
client, outputColumnNames
-
-
Constructor Summary
Constructors Constructor Description OpenAIChatModelFunction(org.apache.flink.table.factories.ModelProviderFactory.Context factoryContext, org.apache.flink.configuration.ReadableConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Collection<org.apache.flink.table.data.RowData>>asyncPredictInternal(String input)protected StringgetEndpointSuffix()-
Methods inherited from class org.apache.flink.model.openai.AbstractOpenAIModelFunction
asyncPredict, close, handleErrorsAndRespond, open, validateSingleColumnSchema
-
Methods inherited from class org.apache.flink.table.functions.AsyncTableFunction
getKind, getTypeInference
-
Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction
functionIdentifier, toString
-
-
-
-
Field Detail
-
ENDPOINT_SUFFIX
public static final String ENDPOINT_SUFFIX
- See Also:
- Constant Field Values
-
STOP_SEPARATOR
public static final String STOP_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEndpointSuffix
protected String getEndpointSuffix()
- Specified by:
getEndpointSuffixin classAbstractOpenAIModelFunction
-
asyncPredictInternal
public CompletableFuture<Collection<org.apache.flink.table.data.RowData>> asyncPredictInternal(String input)
- Specified by:
asyncPredictInternalin classAbstractOpenAIModelFunction
-
-