-
Notifications
You must be signed in to change notification settings - Fork 63
feat: add support for connected accounts #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Script to update @auth0/ai packages to their latest versions | ||
| # Usage: ./update_packages.sh | ||
|
|
||
| set -e | ||
|
|
||
| # Define the versions | ||
| AUTH0_SPA_JS_VERSION="^2.9.0" | ||
| AUTH0_NEXTJS_VERSION="^4.13.0" | ||
| AUTH0_AI_VERSION="^5.1.1" | ||
| AUTH0_AI_VERCEL_VERSION="^4.1.0" | ||
| AUTH0_AI_LANGCHAIN_VERSION="^4.1.0" | ||
| AUTH0_AI_LLAMAINDEX_VERSION="^4.1.0" | ||
|
|
||
| REGISTRY="--registry https://registry.npmjs.org/" | ||
|
|
||
| echo "Starting package updates..." | ||
|
|
||
| # Function to update a package.json file and reinstall packages | ||
| update_package_json() { | ||
| local file="$1" | ||
| local updated=false | ||
|
|
||
| echo "Checking $file..." | ||
|
|
||
| if grep -q '"@auth0/auth0-spa-js"' "$file"; then | ||
| echo " Updating @auth0/auth0-spa-js to $AUTH0_SPA_JS_VERSION" | ||
| sed -i '' 's/"@auth0\/auth0-spa-js": "[^"]*"/"@auth0\/auth0-spa-js": "'$AUTH0_SPA_JS_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/nextjs-auth0"' "$file"; then | ||
| echo " Updating @auth0/nextjs-auth0 to $AUTH0_NEXTJS_VERSION" | ||
| sed -i '' 's/"@auth0\/nextjs-auth0": "[^"]*"/"@auth0\/nextjs-auth0": "'$AUTH0_NEXTJS_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai"' "$file"; then | ||
| echo " Updating @auth0/ai to $AUTH0_AI_VERSION" | ||
| sed -i '' 's/"@auth0\/ai": "[^"]*"/"@auth0\/ai": "'$AUTH0_AI_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-vercel"' "$file"; then | ||
| echo " Updating @auth0/ai-vercel to $AUTH0_AI_VERCEL_VERSION" | ||
| sed -i '' 's/"@auth0\/ai-vercel": "[^"]*"/"@auth0\/ai-vercel": "'$AUTH0_AI_VERCEL_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-langchain"' "$file"; then | ||
| echo " Updating @auth0/ai-langchain to $AUTH0_AI_LANGCHAIN_VERSION" | ||
| sed -i '' 's/"@auth0\/ai-langchain": "[^"]*"/"@auth0\/ai-langchain": "'$AUTH0_AI_LANGCHAIN_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-llamaindex"' "$file"; then | ||
| echo " Updating @auth0/ai-llamaindex to $AUTH0_AI_LLAMAINDEX_VERSION" | ||
| sed -i '' 's/"@auth0\/ai-llamaindex": "[^"]*"/"@auth0\/ai-llamaindex": "'$AUTH0_AI_LLAMAINDEX_VERSION'"/g' "$file" | ||
| updated=true | ||
| fi | ||
|
|
||
| if [ "$updated" = true ]; then | ||
| echo " Updated $file" | ||
| dir=$(dirname "$file") | ||
|
|
||
| # Simple approach: collect all @auth0 packages, uninstall them, then reinstall | ||
| packages_to_uninstall="" | ||
| packages_to_reinstall="" | ||
|
|
||
| if grep -q '"@auth0/auth0-spa-js":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/auth0-spa-js" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/auth0-spa-js@$AUTH0_SPA_JS_VERSION" | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/nextjs-auth0":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/nextjs-auth0" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/nextjs-auth0@$AUTH0_NEXTJS_VERSION" | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/ai" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/ai@$AUTH0_AI_VERSION" | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-vercel":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/ai-vercel" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/ai-vercel@$AUTH0_AI_VERCEL_VERSION" | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-langchain":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/ai-langchain" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/ai-langchain@$AUTH0_AI_LANGCHAIN_VERSION" | ||
| fi | ||
|
|
||
| if grep -q '"@auth0/ai-llamaindex":' "$file"; then | ||
| packages_to_uninstall="$packages_to_uninstall @auth0/ai-llamaindex" | ||
| packages_to_reinstall="$packages_to_reinstall @auth0/ai-llamaindex@$AUTH0_AI_LLAMAINDEX_VERSION" | ||
| fi | ||
|
|
||
| # Uninstall all @auth0 packages at once | ||
| if [ -n "$packages_to_uninstall" ]; then | ||
| echo " Uninstalling:$packages_to_uninstall" | ||
| (cd "$dir" && npm uninstall$packages_to_uninstall 2>/dev/null || true) | ||
| fi | ||
|
|
||
| # Reinstall all @auth0 packages at once | ||
| if [ -n "$packages_to_reinstall" ]; then | ||
| echo " Reinstalling:$packages_to_reinstall" | ||
| (cd "$dir" && npm install$packages_to_reinstall $REGISTRY) | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| # Find all package.json files and update them | ||
| find . -name "package.json" -type f -not -path "*/node_modules/*" | while read -r file; do | ||
| if grep -q '@auth0/ai' "$file"; then | ||
| update_package_json "$file" | ||
| fi | ||
| done | ||
|
|
||
| echo "Package updates completed!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ Next, you'll need to set up environment variables in your repo's `.env.local` fi | |
| To start with the basic examples, you'll just need to add your OpenAI API key and Auth0 credentials. | ||
|
|
||
| - To start with the examples, you'll just need to add your OpenAI API key and Auth0 credentials for the Web app and Machine to Machine App. | ||
| - You can setup a new Auth0 tenant with an Auth0 Web App and Token Vault following the Prerequisites instructions [here](https://auth0.com/ai/docs/call-others-apis-on-users-behalf). | ||
| - You can set up a new Auth0 tenant with an Auth0 Web App and Token Vault following the Prerequisites instructions [here](https://auth0.com/ai/docs/get-started/call-others-apis-on-users-behalf). | ||
| - An Auth0 FGA account, you can create one [here](https://dashboard.fga.dev). Add the FGA store ID, client ID, client secret, and API URL to the `.env.local` file. | ||
| - Optionally add a [SerpAPI](https://serpapi.com/) API key for using web search tool. | ||
|
|
||
|
|
@@ -67,7 +67,7 @@ Agent configuration lives in `src/lib/agent.ts`. From here, you can change the p | |
| This package has [@next/bundle-analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) set up by default - you can explore the bundle size interactively by running: | ||
|
|
||
| ```bash | ||
| $ ANALYZE=true bun run build | ||
| $ ANALYZE=true npm run build | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking: we could remove all bun instructions if we are not using bun anymore https://github.com/auth0-samples/auth0-assistant0/pull/18/files#diff-22629912537b3de4818a8a89789cb4eaa8fe06dfcef74c6041530d9eff46246aR41-R54 |
||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this py-langchain example, on the backend it seems like we will need the equivalent of:
updated in the python sdk?
Also, seems we could likely also include the
openidscope within:https://github.com/auth0-samples/auth0-assistant0/blob/main/py-langchain/backend/app/core/auth0_ai.py#L17-L20
yes? (leaving as a reminder for later if this is the case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we'll need this change: auth0/auth0-fastapi#67
And this one: auth0/auth0-ai-python#55