Skip to content

Conversation

@utkarshm1999
Copy link
Contributor

@utkarshm1999 utkarshm1999 commented Apr 11, 2025

  • removed parsing .data from all methods
  • updated docs to reflect that

EntelligenceAI PR Summary

This PR simplifies the SmallestAI SDK API by modifying return types to provide direct data access instead of wrapped response objects.

  • Modified atoms_client.py to return response.data or response.status instead of full response objects
  • Updated all documentation to reflect new return types and remove '.data' property access
  • Updated test assertions to match new return types (strings, booleans, or specific DTOs)
  • Bumped version from 3.0.1 to 3.0.2 in pyproject.toml
  • Updated README.md with correct import paths and class names

@entelligence-ai-pr-reviews
Copy link

🔒 Entelligence AI Vulnerability Scanner

No security vulnerabilities found!

Your code passed our comprehensive security analysis.

📊 Files Analyzed: 1 files


@entelligence-ai-pr-reviews
Copy link

Review Summary

@entelligence-ai-pr-reviews
Copy link

Walkthrough

This PR updates the SmallestAI SDK to version 3.0.2, focusing on simplifying the API response handling. The main change is modifying how client methods return data - instead of returning full response objects that require accessing data through a '.data' property, methods now return direct values (strings, booleans, or model objects). This improves usability by providing cleaner access to actual data. The PR updates documentation and tests to reflect these changes, correcting import statements, class names, and return type references throughout the codebase.

Changes

File(s) Summary
smallestai/atoms/atoms_client.py Modified all client methods to return direct data (response.data or response.status) instead of full response objects.
README.md Updated import statements, class names, and method return handling to reflect SDK refactoring.
pyproject.toml Bumped version from 3.0.1 to 3.0.2.
docs/atoms/AgentTemplatesApi.md
docs/atoms/AgentsApi.md
docs/atoms/CallsApi.md
docs/atoms/CampaignsApi.md
docs/atoms/KnowledgeBaseApi.md
docs/atoms/LogsApi.md
docs/atoms/OrganizationApi.md
docs/atoms/UserApi.md
Updated documentation to reflect simplified return types and direct response access instead of using '.data' property.
tests/atoms/test_agent_templates_api.py
tests/atoms/test_agents_api.py
tests/atoms/test_calls_api.py
tests/atoms/test_campaigns_api.py
tests/atoms/test_knowledge_base_api.py
tests/atoms/test_logs_api.py
tests/atoms/test_organization_api.py
tests/atoms/test_user_api.py
Updated test assertions to match new return types (strings, booleans, or specific DTOs instead of response wrapper objects).

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    title Retool AI API Client Response Handling Pattern

    participant Client as "API Client User"
    participant RetoolAI as "RetoolAI Client"
    participant API as "Specific API Service<br>(agents_api, knowledge_base_api, etc.)"
    participant Response as "API Response Object"

    Note over RetoolAI, API: Pattern applied to all API methods

    %% Example flow for a typical method
    Client->>RetoolAI: call method (e.g., create_agent())
    activate RetoolAI
    
    RetoolAI->>API: call corresponding API method
    activate API
    API-->>Response: create response object
    API-->>RetoolAI: return full response
    deactivate API
    
    Note right of RetoolAI: Before: directly return API response
    Note right of RetoolAI: After: extract specific data from response

    %% New pattern
    RetoolAI->>Response: extract specific field (data or status)
    RetoolAI-->>Client: return only the needed data
    deactivate RetoolAI

    %% Show different return types
    Note over RetoolAI, Response: Return patterns:
    Note over RetoolAI, Response: - Most methods: return response.data
    Note over RetoolAI, Response: - Delete methods: return response.status
    Note over RetoolAI, Response: - Upload methods: return response.status
    Note over RetoolAI, Response: - Campaign control methods: return response.status
Loading

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

@entelligence-ai-pr-reviews
Copy link

LGTM 👍

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.

2 participants