Django ORM
All models for the Provider app.
- class smarter.apps.provider.models.Provider(*args, **kwargs)[source]
Bases:
MetaDataWithOwnershipModelProvider model.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
name (Unknown) – Name. Name in camelCase, e.g., ‘apiKey’, no special characters.
description (Unknown) – Description. A brief description of this resource. Be verbose, but not too verbose.
version (Unknown) – Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.
annotations (Unknown) – Annotations. Key-value pairs for annotating this resource.
status (Unknown) – Status
is_default (Unknown) – Is default
is_active (Unknown) – Is active
is_verified (Unknown) – Is verified
is_featured (Unknown) – Is featured
is_deprecated (Unknown) – Is deprecated
is_flagged (Unknown) – Is flagged
is_suspended (Unknown) – Is suspended
base_url (Unknown) – Base url. The base URL for the provider’s API.
default_model (Unknown) – Default model. The default model to use for the provider.
connectivity_test_path (Unknown) – Connectivity test path. The URL to test connectivity with the provider’s API.
logo (Unknown) – Logo. The logo of the provider.
website_url (Unknown) – Website url. The website_url URL of the provider.
ownership_requested (Unknown) – Ownership requested. The email address of an alternative contact who has requested to take ownership of the provider.
contact_email (Unknown) – Contact email. The contact email of the provider.
contact_email_verified (Unknown) – Contact email verified. The date and time when the contact email was verified.
support_email (Unknown) – Support email. The support email of the provider.
support_email_verified (Unknown) – Support email verified. The date and time when the support email was verified.
docs_url (Unknown) – Docs url. The documentation URL of the provider.
terms_of_service_url (Unknown) – Terms of service url. The terms of service URL of the provider.
privacy_policy_url (Unknown) – Privacy policy url. The privacy policy URL of the provider.
tos_accepted_at (Unknown) – Tos accepted at. The date and time when the terms of service were accepted.
Relationship fields:
- Parameters:
user_profile (Unknown) – User profile (related name:
provider)api_key (Unknown) – Api key. The API key for the provider. (related name:
provider_api_key)tos_accepted_by (Unknown) – Tos accepted by. The user who accepted the terms of service. (related name:
tos_accepted_by)tags (Unknown) – Tags. Tags for categorizing and organizing this resource. (related name:
provider)tagged_items (Unknown) – Tagged items (related name:
+)
Reverse relationships:
- Parameters:
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- api_key
ForeignKeytoSecretApi key. The API key for the provider. (related name:
provider_api_key)- Type:
Type
- connectivity_test_path
-
Connectivity test path. The URL to test connectivity with the provider’s API.
- Type:
Type
- contact_email
-
Contact email. The contact email of the provider.
- Type:
Type
- contact_email_verified
-
Contact email verified. The date and time when the contact email was verified.
- Type:
Type
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- description
-
Description. A brief description of this resource. Be verbose, but not too verbose.
- Type:
Type
- classmethod get_cached_provider_by_account_id_and_name(invalidate=False, account_id=None, name=None)[source]
Get a cached provider by account ID and name.
- classmethod get_cached_provider_by_user_and_name(invalidate=False, user=None, name='')[source]
Return a single instance of Provider by name for the given user.
This method caches the results to improve performance.
- classmethod get_cached_providers_for_user(invalidate=False, user=None)[source]
Get cached providers for a user.
- get_status_display(*, field=<django.db.models.CharField: status>)
Shows the label of the
status. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- is_active
-
Is active
- Type:
Type
- is_default
-
Is default
- Type:
Type
- is_deprecated
-
Is deprecated
- Type:
Type
- is_featured
-
Is featured
- Type:
Type
- is_flagged
-
Is flagged
- Type:
Type
- is_suspended
-
Is suspended
- Type:
Type
- is_verified
-
Is verified
- Type:
Type
- logo
-
Logo. The logo of the provider.
- Type:
Type
- property manifest_url: str | None
Returns the URL to the plugin’s manifest.
This property constructs the URL to the plugin’s manifest based on its kind and RFC 1034-compliant name. The URL follows the pattern:
/plugins/{kind}/{name}/manifest/, where{kind}is the RFC 1034-compliant kind of the plugin, and{name}is the RFC 1034-compliant name of the plugin.Example:
self.rfc1034_compliant_kind # 'static' self.rfc1034_compliant_name # 'example-plugin self.manifest_url # '/plugins/static/example-plugin/manifest/'
- objects: MetaDataWithOwnershipModelManager = <smarter.apps.account.models.metadata_with_ownership.MetaDataWithOwnershipModelManager object>
- ownership_requested
-
Ownership requested. The email address of an alternative contact who has requested to take ownership of the provider.
- Type:
Type
- providermodel_set
Reverse
ForeignKeyfromProviderModelAll Provider Models of this Provider (related name of
provider)- Type:
Type
- providerverification_set
Reverse
ForeignKeyfromProviderVerificationAll Provider Verifications of this Provider (related name of
provider)- Type:
Type
- property rfc1034_compliant_name: str | None
Returns a URL-friendly name for the llm_client.
This property returns an RFC 1034-compliant name for the llm_client, suitable for use in URLs and DNS labels.
Example:
self.name = 'Example LLMClient 1' self.rfc1034_compliant_name # 'example-llm_client-1'
- Returns:
The RFC 1034-compliant name, or None if
self.nameis not set.- Return type:
Optional[str]
- status
-
Status
Choices:
unverifiedverifyingfailedverifiedsuspendeddeprecated
- Type:
Type
- support_email
-
Support email. The support email of the provider.
- Type:
Type
- support_email_verified
-
Support email verified. The date and time when the support email was verified.
- Type:
Type
- tagged_items
Reverse
GenericRelationfromProviderAll + of this tagged item (related name of
tagged_items)- Type:
Type
- tags = <taggit.managers._TaggableManager object>
- terms_of_service_url
-
Terms of service url. The terms of service URL of the provider.
- Type:
Type
- test_connectivity()[source]
Test connectivity to the provider’s API.
This method should be overridden by subclasses to implement specific connectivity tests.
- Return type:
- tos_accepted_at
-
Tos accepted at. The date and time when the terms of service were accepted.
- Type:
Type
- tos_accepted_by
ForeignKeytoUserTos accepted by. The user who accepted the terms of service. (related name:
tos_accepted_by)- Type:
Type
- tos_accepted_by_id
Internal field, use
tos_accepted_byinstead.
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- user_profile
-
User profile (related name:
provider)- Type:
Type
- user_profile_id
Internal field, use
user_profileinstead.
- vector_databases
Reverse
ForeignKeyfromEmbeddingsInterfaceAll vector databases of this Provider (related name of
provider)- Type:
Type
- verify()[source]
Request a batch of acceptance tests.
Set the status but don’t change the is_verified flag. This is used to indicate that the provider is being verified but has not yet been activated.
- version
-
Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.
- Type:
Type
- class smarter.apps.provider.models.ProviderModel(*args, **kwargs)[source]
Bases:
TimestampedModelProvider completion models for a provider.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
name (Unknown) – Name
description (Unknown) – Description
is_default (Unknown) – Is default
is_active (Unknown) – Is active
is_deprecated (Unknown) – Is deprecated
is_flagged (Unknown) – Is flagged
is_suspended (Unknown) – Is suspended
max_completion_tokens (Unknown) – Max completion tokens
temperature (Unknown) – Temperature
top_p (Unknown) – Top p
supports_text_input (Unknown) – Supports text input
supports_text_generation (Unknown) – Supports text generation
supports_translation (Unknown) – Supports translation
supports_summarization (Unknown) – Supports summarization
supports_streaming (Unknown) – Supports streaming
supports_tools (Unknown) – Supports tools
supports_image_input (Unknown) – Supports image input
supports_audio_input (Unknown) – Supports audio input
supports_embedding (Unknown) – Supports embedding
supports_fine_tuning (Unknown) – Supports fine tuning
supports_search (Unknown) – Supports search
supports_code_interpreter (Unknown) – Supports code interpreter
supports_image_generation (Unknown) – Supports image generation
supports_audio_generation (Unknown) – Supports audio generation
Relationship fields:
- Parameters:
provider (Unknown) – Provider (related name:
providermodel)
Reverse relationships:
- Parameters:
providermodelverification (Unknown) – All Provider Model Verifications of this Provider Model (related name of
provider_model)vector_databases (Unknown) – All vector databases of this Provider Model (related name of
provider_model)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- id
-
Primary key: ID
- Type:
Type
- is_active
-
Is active
- Type:
Type
- is_default
-
Is default
- Type:
Type
- is_deprecated
-
Is deprecated
- Type:
Type
- is_flagged
-
Is flagged
- Type:
Type
- is_suspended
-
Is suspended
- Type:
Type
- max_completion_tokens
-
Max completion tokens
- Type:
Type
- objects = <django.db.models.Manager object>
- provider
-
Provider (related name:
providermodel)- Type:
Type
- providermodelverification_set
Reverse
ForeignKeyfromProviderModelVerificationAll Provider Model Verifications of this Provider Model (related name of
provider_model)- Type:
Type
- supports_audio_generation
-
Supports audio generation
- Type:
Type
- supports_audio_input
-
Supports audio input
- Type:
Type
- supports_code_interpreter
-
Supports code interpreter
- Type:
Type
- supports_embedding
-
Supports embedding
- Type:
Type
- supports_fine_tuning
-
Supports fine tuning
- Type:
Type
- supports_image_generation
-
Supports image generation
- Type:
Type
- supports_image_input
-
Supports image input
- Type:
Type
- supports_search
-
Supports search
- Type:
Type
- supports_streaming
-
Supports streaming
- Type:
Type
- supports_summarization
-
Supports summarization
- Type:
Type
- supports_text_generation
-
Supports text generation
- Type:
Type
- supports_text_input
-
Supports text input
- Type:
Type
- supports_tools
-
Supports tools
- Type:
Type
- supports_translation
-
Supports translation
- Type:
Type
- temperature
-
Temperature
- Type:
Type
- top_p
-
Top p
- Type:
Type
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- vector_databases
Reverse
ForeignKeyfromEmbeddingsInterfaceAll vector databases of this Provider Model (related name of
provider_model)- Type:
Type
- class smarter.apps.provider.models.ProviderModelTypedDict[source]
Bases:
TypedDictTypedDict for provider model information.
- class smarter.apps.provider.models.ProviderModelVerification(*args, **kwargs)[source]
Bases:
TimestampedModelProvider completion model verifications for a provider.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
verification_type (Unknown) – Verification type
is_successful (Unknown) – Is successful
error_message (Unknown) – Error message
Relationship fields:
- Parameters:
provider_model (Unknown) – Provider model (related name:
providermodelverification)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- get_verification_type_display(*, field=<django.db.models.CharField: verification_type>)
Shows the label of the
verification_type. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- is_successful
-
Is successful
- Type:
Type
- objects = <django.db.models.Manager object>
- provider_model
-
Provider model (related name:
providermodelverification)- Type:
Type
- provider_model_id
Internal field, use
provider_modelinstead.
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- class smarter.apps.provider.models.ProviderModelVerificationTypes(*values)[source]
Bases:
TextChoices- AUDIO_INPUT = 'audio_input'
- CODE_INTERPRETER = 'code_interpreter'
- FINE_TUNING = 'fine_tuning'
- IMAGE_INPUT = 'image_input'
- SEARCH = 'search'
- STREAMING = 'streaming'
- SUMMARIZATION = 'summarization'
- TEXT_INPUT = 'text_input'
- TEXT_TO_AUDIO = 'text_to_audio'
- TEXT_TO_IMAGE = 'text_to_image'
- TEXT_TO_TEXT = 'text_to_text'
- TOOLS = 'tools'
- TRANSLATION = 'translation'
- class smarter.apps.provider.models.ProviderStatus(*values)[source]
Bases:
TextChoices- DEPRECATED = 'deprecated'
- FAILED = 'failed'
- SUSPENDED = 'suspended'
- UNVERIFIED = 'unverified'
- VERIFIED = 'verified'
- VERIFYING = 'verifying'
- class smarter.apps.provider.models.ProviderVerification(*args, **kwargs)[source]
Bases:
TimestampedModelProvider completion model verifications for a provider.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
verification_type (Unknown) – Verification type
is_successful (Unknown) – Is successful
error_message (Unknown) – Error message
Relationship fields:
- Parameters:
provider (Unknown) – Provider (related name:
providerverification)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- get_verification_type_display(*, field=<django.db.models.CharField: verification_type>)
Shows the label of the
verification_type. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- is_successful
-
Is successful
- Type:
Type
- objects = <django.db.models.Manager object>
- provider
-
Provider (related name:
providerverification)- Type:
Type
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- class smarter.apps.provider.models.ProviderVerificationTypes(*values)[source]
Bases:
TextChoices- API_CONNECTIVITY = 'api_connectivity'
- CONTACT_EMAIL = 'contact_email'
- LOGO = 'logo'
- PRIVACY_POLICY_URL = 'privacy_policy_url'
- PRODUCTION_API_KEY = 'production_api_key'
- SUPPORT_EMAIL = 'support_email'
- TOS_ACCEPTANCE = 'tos_acceptance'
- TOS_URL = 'tos_url'
- WEBSITE_URL = 'website_url'
- smarter.apps.provider.models.get_model_for_provider(provider_name, model_name=None)[source]
Get the model for a provider by name and account number.
This is the primary way to retrieve a model for a provider. Raises a Smarter error if anything goes wrong.
- Return type:
- smarter.apps.provider.models.get_models_for_provider(provider_name)[source]
Get all models for a provider by name and account number.
This is the primary way to retrieve all models for a provider. Raises a Smarter error if anything goes wrong.
- Return type:
- smarter.apps.provider.models.get_provider(provider_name)[source]
Get the provider by name and account number.
This is the primary way to retrieve a provider. Raises a Smarter error if anything goes wrong.
- Return type: