Skip to content

Conversation

@priley86
Copy link
Contributor

@priley86 priley86 commented Oct 2, 2025

Updates all examples with latest auth0-ai python and auth0-ai-js packages.

note: currently awaiting release/publish of these package updates being made in:
auth0/auth0-ai-python#51
auth0/auth0-ai-js#285

Planning to update all packages after release, but going ahead w/ review requests.

cc: @pmalouin

@priley86 priley86 force-pushed the auth0-ai-sdk-updates branch from 5fcf940 to fff1044 Compare October 2, 2025 20:51
Comment on lines 93 to 95
"resolutions": {
"@auth0/ai": "file:auth0-ai-0.0.0.tgz"
}
Copy link
Contributor Author

@priley86 priley86 Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to myself to:

  • remove the @auth0/ai package reference after release/publish of those packages
  • remove the resolutions reference
  • (and upgrade the @auth0/ai-langchain refernce)

These are temporary while testing w/ the local pnpm packages to test that nested dependency.

@@ -1,34 +1,148 @@
import { type Message } from "@langchain/langgraph-sdk";
import { type Message, type AIMessage } from '@langchain/langgraph-sdk';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added similar chat message bubble / tool call display that we've added recently in:
auth0-samples/auth0-ai-samples#7

see changes here and in chat-window.tsx.

Comment on lines +18 to +34
export const withGoogleConnection = auth0AICustomAPI.withTokenVault({
connection: 'google-oauth2',
scopes: [
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/gmail.compose',
'https://www.googleapis.com/auth/calendar.events',
],
accessToken: async (_, config) => {
return config.configurable?.langgraph_auth_user?.getRawAccessToken();
},
subjectTokenType: SUBJECT_TOKEN_TYPES.SUBJECT_TYPE_ACCESS_TOKEN,
});

// CIBA flow for user confirmation
export const withAsyncAuthorization = auth0AI.withAsyncUserConfirmation({
// Async Authorization flow for user confirmation
// Note: you must use a client application that has the CIBA grant type enabled
// in this case, we can use auth0 regular web app client
const auth0AI = new Auth0AI();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to use separate clients here in this example (authAI vs auth0AICustomAPI), b/c the Resource Server Client/Custom API Client currently does not support CIBA grant types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per discussion today, we can expect that Custom API Client should support CIBA in the future, but opting to use the Regular Web App client's credentials for now (so we do not need to introduce another client w/ this example). In the long run, we should be able to simply use the same Custom API Client.

},
bindingMessage: async ({ product, qty }) => `Do you want to buy ${qty} ${product}`,
scopes: ['openid', 'product:buy'],
scopes: ['openid', 'buy:product'],
Copy link
Contributor Author

@priley86 priley86 Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanted to call out that, regarding the scope conventions used in these examples, the default consent screen currently renders "{noun}: {verb} your {noun}" with respect to the scope used. So you can't really change this at the moment unless you use a custom prompt template. We do also allow custom scope descriptions though, but this is an additional setting, and prefer to use this sort of convention moving forward w/ the scope names by default "{verb}:{noun}".

https://auth0.com/docs/customize/login-pages/customize-consent-prompts

Screenshot 2025-10-06 at 12 30 00 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've opted to defer this update till' future (to reduce further headache w/ these SDK updates)
e4b0ac7

@priley86 priley86 marked this pull request as ready for review October 7, 2025 16:28
Copy link
Contributor

@pmalouin pmalouin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all LGTM (except the references that will need to be updated once we have the packages)

"@langchain/community": "0.3.49",
"@langchain/core": "0.3.63",
"@langchain/langgraph": "0.3.8",
"@langchain/community": "^0.3.53",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested the Gmail and Google Cal tools still work here, although i prefer to no longer use this dependency if we can avoid it in the future. The zod versions are poorly maintained right now in those @langchain/community tool schemas, and this usage of these tools seems to be just a convenience (where we could provide a simple inline tool also).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it also has the dated transitive dotenvdependency it seems.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya lets drop these tools, they are often broken

pmalouin
pmalouin previously approved these changes Oct 16, 2025
Comment on lines +87 to +88
npm install # or bun install
npm run dev # or bun run dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: we can stick with npm instructions only

deepu105
deepu105 previously approved these changes Oct 16, 2025
Copy link
Contributor

@deepu105 deepu105 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks ok

Co-authored-by: Deepu K Sasidharan <d4udts@gmail.com>
@priley86 priley86 dismissed stale reviews from deepu105 and pmalouin via 044eecf October 16, 2025 13:10
@deepu105 deepu105 merged commit 18430dc into auth0-samples:main Oct 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants