Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions libs/labelbox/src/labelbox/schema/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,25 +1118,27 @@ def get_label_count(self) -> int:
res = self.client.execute(query_str, {"projectId": self.uid})
return res["project"]["labelCount"]

def add_model_config(self, model_config_id: str) -> str:
def add_model_config(self, model_config_id: str, response_count: Optional[int] = None) -> str:
"""Adds a model config to this project.

Args:
model_config_id (str): ID of a model config to add to this project.
response_count (Optional[int]): Number of responses to generate. If not provided, uses the default.

Returns:
str, ID of the project model config association. This is needed for updating and deleting associations.
"""

query = """mutation CreateProjectModelConfigPyApi($projectId: ID!, $modelConfigId: ID!) {
createProjectModelConfig(input: {projectId: $projectId, modelConfigId: $modelConfigId}) {
query = """mutation CreateProjectModelConfigPyApi($projectId: ID!, $modelConfigId: ID!, $responseCount: Int) {
createProjectModelConfig(input: {projectId: $projectId, modelConfigId: $modelConfigId, responseCount: $responseCount}) {
projectModelConfigId
}
}"""

params = {
"projectId": self.uid,
"modelConfigId": model_config_id,
"responseCount": response_count,
}
try:
result = self.client.execute(query, params)
Expand Down
Loading