Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd3f63fa

Browse files
committed
feat: default prompt cache key
1 parent097ddd0 commitd3f63fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎api/server/src/main/java/com/ke/bella/openapi/protocol/completion/OpenAIAdaptor.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packagecom.ke.bella.openapi.protocol.completion;
22

3+
importcom.ke.bella.openapi.EndpointContext;
34
importorg.apache.commons.collections4.CollectionUtils;
45
importorg.apache.commons.collections4.MapUtils;
56
importorg.apache.commons.lang3.StringUtils;
@@ -31,6 +32,9 @@ public class OpenAIAdaptor implements CompletionAdaptorDelegator<OpenAIProperty>
3132
@Override
3233
publicCompletionResponsecompletion(CompletionRequestrequest,Stringurl,OpenAIPropertyproperty,Callbacks.HttpDelegatordelegator) {
3334
CompletionResponseresponse;
35+
if(request.getPrompt_cache_key() ==null) {
36+
request.setPrompt_cache_key(EndpointContext.getProcessData().getAkCode());
37+
}
3438
if(delegator ==null) {
3539
RequesthttpRequest =buildRequest(request,url,property);
3640

@@ -49,6 +53,9 @@ public CompletionResponse completion(CompletionRequest request, String url, Open
4953
@Override
5054
publicvoidstreamCompletion(CompletionRequestrequest,Stringurl,OpenAIPropertyproperty,StreamCompletionCallbackcallback,
5155
Callbacks.StreamDelegatordelegator) {
56+
if(request.getPrompt_cache_key() ==null) {
57+
request.setPrompt_cache_key(EndpointContext.getProcessData().getAkCode());
58+
}
5259
CompletionSseListenerlistener =newCompletionSseListener(callback,sseConverter);
5360
if(delegator ==null) {
5461
RequesthttpRequest =buildRequest(request,url,property);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp