Skip to content

Commit

Permalink
feat(LAB-3168): remove status from CreateLLMAsset resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
paulruelle committed Nov 5, 2024
1 parent 530828a commit c589aff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/kili/adapters/kili_api_gateway/llm/operations_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,11 @@ def create_llm_asset(
self,
project_id: str,
author_id: str,
status: Optional[str] = None,
label_type: Optional[str] = None,
) -> Dict:
"""Create an LLM asset in a project, with optional status and label_type."""
where = map_project_where(project_id)
data = {"author_id": author_id, "status": status, "label_type": label_type}
data = {"author_id": author_id, "label_type": label_type}
data_mapped = map_create_llm_asset_input(data)
variables = {"where": where, "data": data_mapped}
fragment = fragment_builder(["id", "latestLabel.id"])
Expand Down
3 changes: 1 addition & 2 deletions src/kili/llm/presentation/client/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,12 @@ def create_conversation(self, project_id: str, prompt: str) -> List[ChatItemDict
Notes:
- The first chat item corresponds to the user's prompt.
- The subsequent chat items are assistant responses generated by the project's models.
- An LLM asset and a label are created in the project with status "TODO" and labelType "PREDICTION".
- An LLM asset and a label are created in the project with labelType "PREDICTION".
"""
user_id = self.kili_api_gateway.get_current_user(["id"])["id"]
llm_asset = self.kili_api_gateway.create_llm_asset(
project_id=project_id,
author_id=user_id,
status="TODO",
label_type="PREDICTION",
)
asset_id = llm_asset["id"]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/llm/test_create_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_create_conversation(mocker):

kili_api_gateway.get_current_user.assert_called_once_with(["id"])
kili_api_gateway.create_llm_asset.assert_called_once_with(
project_id="project_id", author_id="user_id", status="TODO", label_type="PREDICTION"
project_id="project_id", author_id="user_id", label_type="PREDICTION"
)
kili_api_gateway.create_chat_item.assert_called_once_with(
asset_id="asset_id", label_id="label_id", prompt="prompt text"
Expand Down

0 comments on commit c589aff

Please sign in to comment.