chatbase-dotnet icon indicating copy to clipboard operation
chatbase-dotnet copied to clipboard

Why do we need api_key in Message? Shouldn't it use the api_key in Client?

Open jannavarro opened this issue 7 years ago • 0 comments

I initialized Client class by passing an api key in its constructor. var client = new Client(apikey);

Calling Client.SendAsync with a Message having a null or empty api key will return a BadRequest. If I do set the api key in the Message it works. Isn't the point of having the api key in the client to use that api key across all messages?

I'm thinking that instead of an api key per message it makes more sense to have it per Client instance. A message should focus on what it is - a message and not concern itself with the api key. What do you think?

jannavarro avatar Nov 19 '17 14:11 jannavarro