Skip to content
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

feat: 🎸 telegram #1559

Merged
merged 1 commit into from
Nov 2, 2023
Merged

feat: 🎸 telegram #1559

merged 1 commit into from
Nov 2, 2023

Conversation

StanGirard
Copy link
Collaborator

added connectors and doc

@StanGirard StanGirard temporarily deployed to preview November 2, 2023 08:17 — with GitHub Actions Inactive
@dosubot dosubot bot added the area: backend Related to backend functionality or under the /backend directory label Nov 2, 2023
Copy link

vercel bot commented Nov 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 8:27am
quivr-strapi 🛑 Canceled (Inspect) Nov 2, 2023 8:27am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 8:27am

added connectors and doc
@StanGirard StanGirard temporarily deployed to preview November 2, 2023 08:19 — with GitHub Actions Inactive
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/connectors/telegram_bot/main.py

The code is generally well-written and follows good practices. However, there are a few areas that could be improved for better error handling and readability.

  1. Error Handling: In the handle_message function, the response from the requests.post call is checked for a status code of 200. If it's not 200, an error message is printed and a message is sent to the user. However, the requests.post call itself could fail and throw an exception (for example, if the server is not reachable). It would be better to wrap this call in a try-except block to handle any exceptions that might occur.
try:
    response = requests.post(quivr_url, headers=headers, json={\"question\": user_message})
except Exception as e:
    print(f\"Error: {str(e)}\")
    await context.bot.send_message(chat_id=update.effective_chat.id, text=\"Sorry, there was an error processing your request.\")
    return
  1. Readability: The construction of quivr_url is a bit hard to read due to the inline string formatting. It would be clearer to use an f-string for the entire URL.
quivr_url = f\"{os.getenv('QUIVR_URL', 'https://api.quivr.app')}/chat/{quivr_chat_id}/question?brain_id={quivr_brain_id}\"
  1. Security: The code retrieves several sensitive values from environment variables, such as TELEGRAM_BOT_TOKEN and QUIVR_TOKEN. It's good that these are not hard-coded in the script, but make sure these environment variables are securely managed and not exposed in any logs or error messages.

🔒💡🐛


Powered by Code Review GPT

@StanGirard StanGirard merged commit de3ab00 into main Nov 2, 2023
6 checks passed
mamadoudicko pushed a commit that referenced this pull request Nov 2, 2023
🤖 I have created a release *beep* *boop*
---


## 0.0.103 (2023-11-02)

## What's Changed
* feat: allow to share a public brain link by @mamadoudicko in
#1541
* fix: prompt update in brains management settings tab by @gozineb in
#1543
* refactor: extract prompt from settings by @gozineb in
#1546
* feat: 🎸 telegram by @StanGirard in
#1555
* feat: 🎸 telegram by @StanGirard in
#1559
* docs: update run_fully_local.md by @eltociear in
#1556
* docs: grammatical errors in README.md by @HimanshuMahto in
#1536
* fix: missing or inaccurate zh-cn translations by @jerryshang in
#1558

## New Contributors
* @HimanshuMahto made their first contribution in
#1536
* @jerryshang made their first contribution in
#1558

**Full Changelog**:
v0.0.102...v0.0.103

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
coolCatalyst added a commit to coolCatalyst/quivr that referenced this pull request Jun 1, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.103 (2023-11-02)

## What's Changed
* feat: allow to share a public brain link by @mamadoudicko in
QuivrHQ/quivr#1541
* fix: prompt update in brains management settings tab by @gozineb in
QuivrHQ/quivr#1543
* refactor: extract prompt from settings by @gozineb in
QuivrHQ/quivr#1546
* feat: 🎸 telegram by @StanGirard in
QuivrHQ/quivr#1555
* feat: 🎸 telegram by @StanGirard in
QuivrHQ/quivr#1559
* docs: update run_fully_local.md by @eltociear in
QuivrHQ/quivr#1556
* docs: grammatical errors in README.md by @HimanshuMahto in
QuivrHQ/quivr#1536
* fix: missing or inaccurate zh-cn translations by @jerryshang in
QuivrHQ/quivr#1558

## New Contributors
* @HimanshuMahto made their first contribution in
QuivrHQ/quivr#1536
* @jerryshang made their first contribution in
QuivrHQ/quivr#1558

**Full Changelog**:
QuivrHQ/quivr@v0.0.102...v0.0.103

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant