mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
PM-24367 add personal_id to onyx api call (#6154)
This commit is contained in:
@@ -40,5 +40,6 @@ public class BillingSettings
|
||||
{
|
||||
public virtual string ApiKey { get; set; }
|
||||
public virtual string BaseUrl { get; set; }
|
||||
public virtual int PersonaId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class FreshdeskController : Controller
|
||||
}
|
||||
|
||||
// create the onyx `answer-with-citation` request
|
||||
var onyxRequestModel = new OnyxAnswerWithCitationRequestModel(model.TicketDescriptionText);
|
||||
var onyxRequestModel = new OnyxAnswerWithCitationRequestModel(model.TicketDescriptionText, _billingSettings.Onyx.PersonaId);
|
||||
var onyxRequest = new HttpRequestMessage(HttpMethod.Post,
|
||||
string.Format("{0}/query/answer-with-citation", _billingSettings.Onyx.BaseUrl))
|
||||
{
|
||||
|
||||
@@ -20,11 +20,12 @@ public class OnyxAnswerWithCitationRequestModel
|
||||
[JsonPropertyName("retrieval_options")]
|
||||
public RetrievalOptions RetrievalOptions { get; set; }
|
||||
|
||||
public OnyxAnswerWithCitationRequestModel(string message)
|
||||
public OnyxAnswerWithCitationRequestModel(string message, int personaId = 1)
|
||||
{
|
||||
message = message.Replace(Environment.NewLine, " ").Replace('\r', ' ').Replace('\n', ' ');
|
||||
Messages = new List<Message>() { new Message() { MessageText = message } };
|
||||
RetrievalOptions = new RetrievalOptions();
|
||||
PersonaId = personaId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,5 +31,10 @@
|
||||
"storage": {
|
||||
"connectionString": "UseDevelopmentStorage=true"
|
||||
}
|
||||
},
|
||||
"billingSettings": {
|
||||
"onyx": {
|
||||
"personaId": 68
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
"payPal": {
|
||||
"production": true,
|
||||
"businessId": "4ZDA7DLUUJGMN"
|
||||
}
|
||||
},
|
||||
"onyx": {
|
||||
"personaId": 7
|
||||
}
|
||||
},
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
|
||||
@@ -76,7 +76,8 @@
|
||||
},
|
||||
"onyx": {
|
||||
"apiKey": "SECRET",
|
||||
"baseUrl": "https://cloud.onyx.app/api"
|
||||
"baseUrl": "https://cloud.onyx.app/api",
|
||||
"personaId": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user