Skip to content

Commit

Permalink
add qrcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Aug 5, 2024
1 parent 6dc2e08 commit 9a4e586
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
port: "7437"
database-type: "postgresql"
report-name: "agixt-postgres-tests"
additional-python-dependencies: openai requests agixtsdk
additional-python-dependencies: openai requests agixtsdk qrcode
needs: build-agixt
test-agixt-sqlite:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
Expand All @@ -63,5 +63,5 @@ jobs:
port: "7437"
database-type: "sqlite"
report-name: "agixt-sqlite-tests"
additional-python-dependencies: openai requests agixtsdk
additional-python-dependencies: openai requests agixtsdk qrcode
needs: build-agixt
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
port: "7437"
database-type: "postgresql"
report-name: "agixt-postgres-tests"
additional-python-dependencies: openai requests agixtsdk
additional-python-dependencies: openai requests agixtsdk qrcode
needs: build-agixt
test-agixt-sqlite:
uses: josh-xt/AGiXT/.github/workflows/operation-test-with-jupyter.yml@main
Expand All @@ -43,5 +43,5 @@ jobs:
port: "7437"
database-type: "sqlite"
report-name: "agixt-sqlite-tests"
additional-python-dependencies: openai requests agixtsdk
additional-python-dependencies: openai requests agixtsdk qrcode
needs: build-agixt
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
agixtsdk==0.0.58
agixtsdk==0.0.60
safeexecute==0.0.9
google-generativeai==0.7.2
discord==2.3.2
Expand Down
16 changes: 13 additions & 3 deletions tests/endpoint-tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,27 @@
"\n",
"while failures < 100:\n",
" try:\n",
" new_user = agixt.register_user(\n",
" otp_uri = agixt.register_user(\n",
" email=test_email, first_name=\"Test\", last_name=\"User\"\n",
" )\n",
" print(new_user)\n",
" openai.base_url = \"http://localhost:7437/v1/\"\n",
" openai.api_key = agixt.headers[\"Authorization\"]\n",
" break\n",
" except Exception as e:\n",
" print(e)\n",
" failures += 1\n",
" time.sleep(5)"
" time.sleep(5)\n",
"\n",
"# Show QR code for MFA setup\n",
"import qrcode\n",
"from IPython.display import Image\n",
"\n",
"qr = qrcode.QRCode()\n",
"qr.add_data(otp_uri)\n",
"qr.make(fit=True)\n",
"img = qr.make_image(fill=\"black\", back_color=\"white\")\n",
"img.save(\"qr.png\")\n",
"Image(filename=\"qr.png\")"
]
},
{
Expand Down

0 comments on commit 9a4e586

Please sign in to comment.