Merge pull request #131 from hchen2020/master
Fix get agents in user external id.
This commit is contained in:
commit
bf51213a5a
|
|
@ -10,7 +10,8 @@ public partial class AgentService
|
|||
var db = _services.GetRequiredService<IBotSharpRepository>();
|
||||
var query = from a in db.Agent
|
||||
join ua in db.UserAgent on a.Id equals ua.AgentId
|
||||
where ua.UserId == _user.Id
|
||||
join u in db.User on ua.UserId equals u.Id
|
||||
where ua.UserId == _user.Id || u.ExternalId == _user.Id
|
||||
select a.ToAgent();
|
||||
return query.ToList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ public class ChatCompletionProvider : IChatCompletion
|
|||
var choice = response.Value.Choices[0];
|
||||
var message = choice.Message;
|
||||
|
||||
_logger.LogInformation($"Token Usage: {response.Value.Usage.PromptTokens} prompt + {response.Value.Usage.CompletionTokens} completion = {response.Value.Usage.TotalTokens} total");
|
||||
|
||||
if (choice.FinishReason == CompletionsFinishReason.FunctionCall)
|
||||
{
|
||||
_logger.LogInformation($"[{agent.Name}]: {message.FunctionCall.Name} => {message.FunctionCall.Arguments}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue