public class PromptProvider extends Object
| Constructor and Description |
|---|
PromptProvider(HttpClient httpClient,
String promptEndpoint,
String workspaceId,
PromptCache.PromptCacheConfig cacheConfig) |
PromptProvider(HttpClient httpClient,
String promptEndpoint,
String executeEndpoint,
String executeStreamingEndpoint,
String workspaceId,
PromptCache.PromptCacheConfig cacheConfig) |
| Modifier and Type | Method and Description |
|---|---|
ExecuteResult |
execute(ExecuteParam param)
Execute a prompt.
|
StreamReader<ExecuteResult> |
executeStreaming(ExecuteParam param)
Execute a prompt with streaming response.
|
List<Message> |
formatPrompt(Prompt prompt,
Map<String,Object> variables)
Format prompt with variables.
|
List<Message> |
getAndFormat(GetPromptParam param,
Map<String,Object> variables)
Get and format prompt in one call.
|
Prompt |
getPrompt(GetPromptParam param)
Get a prompt (with caching).
|
void |
invalidateAllCache()
Invalidate all cached prompts.
|
void |
invalidateCache(GetPromptParam param)
Invalidate cache for a prompt.
|
void |
setClient(CozeLoopClient client)
Set the client for tracing.
|
public PromptProvider(HttpClient httpClient, String promptEndpoint, String workspaceId, PromptCache.PromptCacheConfig cacheConfig)
public PromptProvider(HttpClient httpClient, String promptEndpoint, String executeEndpoint, String executeStreamingEndpoint, String workspaceId, PromptCache.PromptCacheConfig cacheConfig)
public void setClient(CozeLoopClient client)
client - the clientpublic Prompt getPrompt(GetPromptParam param)
param - the parameters for getting promptpublic List<Message> formatPrompt(Prompt prompt, Map<String,Object> variables)
prompt - the promptvariables - the variables to substitutepublic List<Message> getAndFormat(GetPromptParam param, Map<String,Object> variables)
param - the parameters for getting promptvariables - the variables to substitutepublic void invalidateCache(GetPromptParam param)
param - the parameters identifying the promptpublic void invalidateAllCache()
public ExecuteResult execute(ExecuteParam param)
param - the execution parameterspublic StreamReader<ExecuteResult> executeStreaming(ExecuteParam param)
param - the execution parametersCopyright © 2026. All rights reserved.