Basic Concepts
Welcome to the Fiscus SDK world! Let's break down the key concepts you'll need to understand to make the most of this powerful tool. We’ll keep things fun, engaging, and, most importantly, easy to follow. 🚀
AI Integration Engineer Overview
At its core, Fiscus is an AI Integration Engineer, but what does that really mean?
-
AI Integration Engineer: Think of Fiscus as the middleman between your AI agents and any API service you want to integrate with. No more messy API mappings or manual code adjustments—Fiscus handles it all!
-
Single Entry Point: Fiscus gives you one unified platform to manage and execute multiple API calls across different services. You define what the AI does, and Fiscus makes it happen.
-
Orchestrate Workflows: Whether it's a simple task or a complex series of API calls, Fiscus lets you chain, orchestrate, and manage them all in one place, seamlessly.
-
AI-Powered: And the best part? Fiscus is built to work with AI frameworks! Your AI agents can now control and interact with multiple APIs effortlessly.
- Python
Stateful vs. Stateless Backends
What’s the difference?
When using Fiscus SDK, you have two backend options. Let’s break them down!
Stateless Backend
-
No Session: The API calls are independent, and no state is saved between requests.
-
Great for Microservices: Perfect for serverless architectures or environments where each request is isolated.
-
How It Works: Every API call carries all the necessary information (like user data, tokens, etc.) within the request itself.
You only need to pass the user's ID when inititalizing the SDK, that will instantiate the User class under the hood for a stateless environment.
client = FiscusClient(api_key='YOUR_FISCUS_API_KEY', user_id="user123")
# Define user details in each request
response = client.execute('Gmail', 'send_email', email_params)
Stateful Backend
-
Session-Based: The SDK keeps track of user sessions across multiple API calls. This does require you to pass that specific user's context when making execution calls through the SDK.
-
Ideal for Applications: Best for systems that maintain persistent sessions or need to track user interactions over time.
-
How It Works: You set up a user context just once for each user, and then pass that into any subsequent API calls for that user.
After setting up the user, you can use the same user session for multiple API calls.
client = FiscusClient(api_key='YOUR_FISCUS_API_KEY')
user = FiscusUser(user_id='user_123', client=client)
# Now you don't need to pass user details every time
response = client.execute('Gmail', 'send_email', email_params, user=user)
Core Components
Let’s meet the stars of the show! 🌟 These are the main classes you’ll work with in Fiscus SDK:
FiscusClient
-
The Heart: This is the primary entry point for interacting with Fiscus.
-
Initialize Once: Set up a
FiscusClient
with your API key and you’re ready to roll. -
Handles Everything: This client manages connections, orchestrates tasks, and executes all your API operations.
Example:
client = FiscusClient(api_key='YOUR_FISCUS_API_KEY')
FiscusUser
-
User Context: Represents a specific user in your application.
-
State Management: With a
FiscusUser
, you can manage user-specific preferences, connectors, and context. -
RBAC & More: Perfect for handling role-based access control and user-specific API integrations.
Example:
user = FiscusUser(user_id='user_456', client=client)
FiscusConnector
-
API Integrations: These are the connectors to different services (like Gmail, CRM systems, etc.).
-
Plug & Play: Add or remove connectors for your users and manage authentication seamlessly.
-
Execute Tasks: Each
FiscusConnector
lets you call operations specific to that API (like sending an email, creating a record, etc.).Example:
# Add a connector to your user
user.add_connector('Gmail')
Now that you’ve got the basics, you’re all set to dive deeper into Fiscus SDK! Whether you’re orchestrating complex workflows or making simple API calls, these concepts will guide you through everything. Ready to start? Let’s move on to some Quickstart Guides and see how it all works in practice! 💡