8000 Support `inputs` parameter for Dify · uezo/ChatdollKit@3f76f7a · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 3f76f7a

Browse files
committed
Support inputs parameter for Dify
Add `Dictionary<string, object> Inputs` to `DifyService`. Now you can set keys and values to pass the parameters for Dify Agents.
1 parent 50700b6 commit 3f76f7a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Scripts/LLM/Dify/DifyService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class DifyService : LLMServiceBase
1616
public string ApiKey;
1717
public string BaseUrl;
1818
public string User;
19+
public Dictionary<string, object> Inputs;
1920

2021
[Header("Network configuration")]
2122
[SerializeField]
@@ -91,7 +92,7 @@ public override async UniTask<ILLMSession> GenerateContentAsync(List<ILLMMessage
9192
difySession.ConversationId = GetConversationId();
9293
}
9394

94-
// Use ConversationId as ContextId, not base.contextId
95+
// Set ConversationId to ContextId for external use, not base.contextId
9596
difySession.ContextId = difySession.ConversationId;
9697

9798
difySession.StreamingTask = StartStreamingAsync(difySession, customParameters, customHeaders, useFunctions, token);
@@ -124,7 +125,7 @@ public virtual async UniTask StartStreamingAsync(DifySession difySession, Dictio
124125
// Make request data
125126
var data = new Dictionary<string, object>()
126127
{
127-
{ "inputs", new Dictionary<string, string>() },
128+
{ "inputs", Inputs ?? new Dictionary<string, object>() },
128129
{ "query", difyRequest.query },
129130
{ "response_mode", "streaming" },
130131
{ "user", User },

Scripts/LLM/Dify/DifyServiceWebGL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override async UniTask StartStreamingAsync(DifySession difySession, Dicti
4444
// Make request data
4545
var data = new Dictionary<string, object>()
4646
{
47-
{ "inputs", new Dictionary<string, string>() },
47+
{ "inputs", Inputs ?? new Dictionary<string, object>() },
4848
{ "query", difyRequest.query },
4949
{ "response_mode", "streaming" },
5050
{ "user", User },

0 commit comments

Comments
 (0)
0