Skip to content

Commit

Permalink
usageTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkSchlossmacher committed Nov 13, 2023
1 parent 83ed6bf commit 0dfabd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
31 changes: 0 additions & 31 deletions app/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,6 @@ declare module "next-auth" {
// }
}

/**
* Options for NextAuth.js used to configure adapters, providers, callbacks, etc.
*
* @see https://next-auth.js.org/configuration/options
*/
/*
export const authOptions: NextAuthOptions = {
callbacks: {
session: ({ session, token }) => ({
...session,
user: {
...session.user,
id: token.sub,
},
}),
},
providers: [
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID ?? "",
clientSecret: process.env.AZURE_AD_CLIENT_SECRET ?? "",
tenantId: process.env.AZURE_AD_TENANT_ID ?? "",
}),
],
pages: {
signIn: "/login",
signOut: "/login",
error: "/login",
},
};
*/

export const authOptions: NextAuthOptions = {
callbacks: {
async signIn({ user, account, profile }) {
Expand Down
2 changes: 2 additions & 0 deletions app/client/platforms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ export class ChatGPTApi implements LLMApi {
},
onmessage(msg) {
if (msg.data === "[DONE]" || finished) {
const usageTokens = json.usage?;
console.log("usageTokens:", usageTokens);
return finish();
}
const text = msg.data;
Expand Down

0 comments on commit 0dfabd6

Please sign in to comment.