Skip to content

Latest commit

 

History

History
112 lines (76 loc) · 3.01 KB

File metadata and controls

112 lines (76 loc) · 3.01 KB

Model

Method HTTP request Release Stage
create POST /v2/models Public Beta
get GET /v2/models/{modelRid} Public Beta

create

Creates a new Model with no versions.

Parameters

Name Type Description Notes
name ModelName
parent_folder_rid FolderRid
preview Optional[PreviewMode] Enables the use of preview functionality. [optional]

Return type

Model

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# ModelName
name = "House Pricing Model"
# FolderRid
parent_folder_rid = "ri.compass.main.folder.c410f510-2937-420e-8ea3-8c9bcb3c1791"
# Optional[PreviewMode] | Enables the use of preview functionality.
preview = None


try:
    api_response = client.models.Model.create(
        name=name, parent_folder_rid=parent_folder_rid, preview=preview
    )
    print("The create response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Model.create: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Model The created Model application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

Retrieves a Model by its Resource Identifier (RID).

Parameters

Name Type Description Notes
model_rid ModelRid
preview Optional[PreviewMode] Enables the use of preview functionality. [optional]

Return type

Model

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# ModelRid
model_rid = None
# Optional[PreviewMode] | Enables the use of preview functionality.
preview = None


try:
    api_response = client.models.Model.get(model_rid, preview=preview)
    print("The get response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling Model.get: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Model application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]