Demos & Docs #42

Merged
Berack96 merged 8 commits from demos into main 2025-10-27 12:42:59 +01:00
Berack96 commented 2025-10-22 09:40:34 +02:00 (Migrated from github.com)

Imoplementate alcune demos e rimosso documenti inutili

Imoplementate alcune demos e rimosso documenti inutili
trojanhorse47 (Migrated from github.com) reviewed 2025-10-22 09:40:34 +02:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-22 13:30:54 +02:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR implements demo scripts for testing API providers, updates social media data models to use consistent timestamp fields, fixes warnings in 4chan wrapper, and resolves Docker dependency issues for X (Twitter) integration. The PR also removes outdated documentation files.

Key Changes

  • Renamed time field to timestamp across all social media models for consistency
  • Fixed Docker build to install Node.js dependencies for X/Twitter API before other dependencies
  • Added BeautifulSoup warning suppression in 4chan wrapper
  • Created simplified demo scripts for market, news, and social API providers

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/app/api/core/social.py Renamed time to timestamp in SocialPost and SocialComment models
src/app/api/social/x.py Updated to use timestamp field and improved variable naming
src/app/api/social/reddit.py Fixed timestamp parameter from milliseconds to seconds
src/app/api/social/chan.py Added warnings filter and docstring
tests/tools/test_socials_tool.py Updated test assertions to use timestamp field
tests/api/test_social_x_api.py Added rettiwt dependency check and updated timestamp assertions
tests/api/test_social_reddit.py Updated timestamp field in test assertions
tests/api/test_social_4chan.py Updated timestamp field in test assertions
Dockerfile Reorganized to install Node.js/npm for rettiwt before Python dependencies
demos/ollama_demo.py Added type hints and type ignore comments
demos/api_socials_providers.py New demo script for social APIs
demos/api_news_providers.py New demo script for news APIs
demos/api_market_providers.py New demo script for market APIs
demos/agno_agent.py Simplified tools list formatting
.env.example Updated X API key documentation reference
docs/*.md Removed outdated documentation files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR implements demo scripts for testing API providers, updates social media data models to use consistent timestamp fields, fixes warnings in 4chan wrapper, and resolves Docker dependency issues for X (Twitter) integration. The PR also removes outdated documentation files. ### Key Changes - Renamed `time` field to `timestamp` across all social media models for consistency - Fixed Docker build to install Node.js dependencies for X/Twitter API before other dependencies - Added BeautifulSoup warning suppression in 4chan wrapper - Created simplified demo scripts for market, news, and social API providers ### Reviewed Changes Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | src/app/api/core/social.py | Renamed `time` to `timestamp` in SocialPost and SocialComment models | | src/app/api/social/x.py | Updated to use `timestamp` field and improved variable naming | | src/app/api/social/reddit.py | Fixed timestamp parameter from milliseconds to seconds | | src/app/api/social/chan.py | Added warnings filter and docstring | | tests/tools/test_socials_tool.py | Updated test assertions to use `timestamp` field | | tests/api/test_social_x_api.py | Added rettiwt dependency check and updated timestamp assertions | | tests/api/test_social_reddit.py | Updated timestamp field in test assertions | | tests/api/test_social_4chan.py | Updated timestamp field in test assertions | | Dockerfile | Reorganized to install Node.js/npm for rettiwt before Python dependencies | | demos/ollama_demo.py | Added type hints and type ignore comments | | demos/api_socials_providers.py | New demo script for social APIs | | demos/api_news_providers.py | New demo script for news APIs | | demos/api_market_providers.py | New demo script for market APIs | | demos/agno_agent.py | Simplified tools list formatting | | .env.example | Updated X API key documentation reference | | docs/*.md | Removed outdated documentation files | </details> --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/Berack96/upo-appAI/new/main/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-22 13:30:54 +02:00

[nitpick] The comment should include basic setup instructions or key requirements for obtaining the X API key, not just a link. Consider adding a brief note like '# Follow the authentication setup guide at: https://www.npmjs.com/package/rettiwt-api' to provide more context.

# Follow the authentication setup guide at: https://www.npmjs.com/package/rettiwt-api
[nitpick] The comment should include basic setup instructions or key requirements for obtaining the X API key, not just a link. Consider adding a brief note like '# Follow the authentication setup guide at: https://www.npmjs.com/package/rettiwt-api' to provide more context. ```suggestion # Follow the authentication setup guide at: https://www.npmjs.com/package/rettiwt-api ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-22 13:30:54 +02:00

Suppressing all warnings globally is too broad and can hide important issues. Consider being more specific by filtering only BeautifulSoup warnings with warnings.filterwarnings('ignore', category=MarkupResemblesLocatorWarning) or by using context managers for specific code blocks.

from bs4 import MarkupResemblesLocatorWarning
from datetime import datetime
from app.api.core.social import *

# Ignora solo i warning di BeautifulSoup relativi a HTML malformato (MarkupResemblesLocatorWarning)
warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)
Suppressing all warnings globally is too broad and can hide important issues. Consider being more specific by filtering only BeautifulSoup warnings with `warnings.filterwarnings('ignore', category=MarkupResemblesLocatorWarning)` or by using context managers for specific code blocks. ```suggestion from bs4 import MarkupResemblesLocatorWarning from datetime import datetime from app.api.core.social import * # Ignora solo i warning di BeautifulSoup relativi a HTML malformato (MarkupResemblesLocatorWarning) warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning) ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-26 16:07:03 +01:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull Request Overview Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments. --- 💡 <a href="/Berack96/upo-appAI/new/main/.github?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@@ -58,3 +42,3 @@
# 3. Chat con streaming --------------------------------------------------------
def chat_streaming(model: str, messages: list) -> str:
def chat_streaming(model: str, messages: list[dict[str, str]]) -> str:
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-26 16:07:01 +01:00

The # type: ignore comment suppresses type checking without specifying what error is being ignored. Use # type: ignore[error-code] to specify the exact type error being suppressed for better maintainability.

            name = getattr(m, 'model', None) or (m.get('model') if isinstance(m, dict) else 'sconosciuto')  # type: ignore[attr-defined]
The `# type: ignore` comment suppresses type checking without specifying what error is being ignored. Use `# type: ignore[error-code]` to specify the exact type error being suppressed for better maintainability. ```suggestion name = getattr(m, 'model', None) or (m.get('model') if isinstance(m, dict) else 'sconosciuto') # type: ignore[attr-defined] ```
@@ -59,3 +43,3 @@
def chat_streaming(model: str, messages: list) -> str:
def chat_streaming(model: str, messages: list[dict[str, str]]) -> str:
"""Esegue una chat mostrando progressivamente la risposta."""
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-26 16:07:02 +01:00

The # type: ignore comment suppresses type checking without specifying what error is being ignored. Use # type: ignore[error-code] to specify the exact type error being suppressed for better maintainability.

            details = getattr(m, 'details', None)  # type: ignore[attr-defined]
The `# type: ignore` comment suppresses type checking without specifying what error is being ignored. Use `# type: ignore[error-code]` to specify the exact type error being suppressed for better maintainability. ```suggestion details = getattr(m, 'details', None) # type: ignore[attr-defined] ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-26 16:07:02 +01:00

The # type: ignore comment suppresses type checking without specifying what error is being ignored. Use # type: ignore[error-code] to specify the exact type error being suppressed for better maintainability.

    response = ollama.chat(  # type: ignore[attr-defined]
The `# type: ignore` comment suppresses type checking without specifying what error is being ignored. Use `# type: ignore[error-code]` to specify the exact type error being suppressed for better maintainability. ```suggestion response = ollama.chat( # type: ignore[attr-defined] ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-26 16:07:03 +01:00

The # type: ignore comment suppresses type checking without specifying what error is being ignored. Use # type: ignore[error-code] to specify the exact type error being suppressed for better maintainability.

    response = ollama.chat(  # type: ignore[attr-defined]
The `# type: ignore` comment suppresses type checking without specifying what error is being ignored. Use `# type: ignore[error-code]` to specify the exact type error being suppressed for better maintainability. ```suggestion response = ollama.chat( # type: ignore[attr-defined] ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-26 16:07:02 +01:00

The # type: ignore comment suppresses type checking without specifying what error is being ignored. Use # type: ignore[error-code] to specify the exact type error being suppressed for better maintainability.

    stream = ollama.chat(model=model, messages=messages, stream=True)  # type: ignore[call-arg]
The `# type: ignore` comment suppresses type checking without specifying what error is being ignored. Use `# type: ignore[error-code]` to specify the exact type error being suppressed for better maintainability. ```suggestion stream = ollama.chat(model=model, messages=messages, stream=True) # type: ignore[call-arg] ```
Simo93-rgb (Migrated from github.com) approved these changes 2025-10-27 12:42:57 +01:00
Sign in to join this conversation.