pltr-cli 0.14.0__tar.gz → 0.14.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/PKG-INFO +1 -1
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/pyproject.toml +1 -1
- pltr_cli-0.14.1/src/pltr/__init__.py +1 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/language_models.py +30 -29
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_language_models.py +31 -34
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/uv.lock +1 -1
- pltr_cli-0.14.0/src/pltr/__init__.py +0 -1
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.github/workflows/ci.yml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.github/workflows/claude-code-review.yml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.github/workflows/claude.yml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.github/workflows/publish.yml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.github/workflows/test-publish.yml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.gitignore +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/.pre-commit-config.yaml +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/CHANGELOG.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/CLAUDE.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/LICENSE +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/README.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/RELEASE.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/README.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/SKILL.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/admin-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/aip-agents-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/connectivity-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/dataset-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/filesystem-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/functions-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/language-models-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/mediasets-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/models-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/ontology-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/orchestration-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/quick-start.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/sql-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/reference/streams-commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/workflows/data-analysis.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/workflows/data-pipeline.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/claude_skill/workflows/permission-management.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/README.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/api/wrapper.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/examples/csv-upload.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/examples/gallery.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/features/dataset-transactions.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/migration/v2-pagination.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/pagination.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/aliases.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/authentication.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/claude-skill.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/commands.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/quick-start.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/troubleshooting.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/docs/user-guide/workflows.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/mypy.ini +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/scripts/release.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/__main__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/base.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/manager.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/oauth.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/storage.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/auth/token.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/cli.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/admin.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/aip_agents.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/alias.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/audit.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/completion.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/configure.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/connectivity.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/cp.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/data_health.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/dataset.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/folder.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/functions.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/language_models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/mediasets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/ontology.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/orchestration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/project.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/resource.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/resource_role.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/shell.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/space.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/sql.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/streams.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/third_party_applications.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/verify.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/commands/widgets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/config/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/config/aliases.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/config/profiles.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/config/settings.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/admin.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/aip_agents.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/audit.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/base.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/connectivity.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/copy.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/data_health.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/dataset.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/folder.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/functions.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/mediasets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/ontology.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/orchestration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/project.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/resource.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/resource_role.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/space.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/sql.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/streams.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/third_party_applications.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/services/widgets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/alias_resolver.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/completion.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/formatting.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/pagination.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/src/pltr/utils/progress.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/conftest.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/README.md +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/conftest.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/test_auth_flow.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/test_cli_integration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/test_data_workflows.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/test_data_workflows_simple.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/integration/test_simple_integration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/test_base.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/test_manager.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/test_oauth.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/test_storage.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_auth/test_token.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_admin.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_aip_agents.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_alias.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_audit.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_completion.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_connectivity.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_data_health.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_dataset.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_folder.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_functions.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_language_models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_mediasets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_ontology.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_orchestration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_shell.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_sql.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_streams.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_third_party_applications.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_verify_simple.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_commands/test_widgets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_config/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_config/test_aliases.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_config/test_profiles.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_config/test_settings.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_admin.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_aip_agents.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_base.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_connectivity.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_copy.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_data_health.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_dataset.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_dataset_transactions.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_folder.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_functions.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_mediasets.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_models.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_ontology.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_orchestration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_pagination_integration.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_project.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_resource.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_resource_role.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_space.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_sql.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_services/test_streams.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_utils/__init__.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_utils/test_alias_resolver.py +0 -0
- {pltr_cli-0.14.0 → pltr_cli-0.14.1}/tests/test_utils/test_pagination.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.14.1"
|
|
@@ -76,29 +76,29 @@ class LanguageModelsService(BaseService):
|
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
-
# Build
|
|
80
|
-
|
|
79
|
+
# Build SDK kwargs
|
|
80
|
+
request_kwargs: Dict[str, Any] = {
|
|
81
81
|
"messages": messages,
|
|
82
|
-
"
|
|
82
|
+
"max_tokens": max_tokens,
|
|
83
|
+
"preview": preview,
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
# Add optional parameters if provided
|
|
86
87
|
if system is not None:
|
|
87
|
-
|
|
88
|
+
request_kwargs["system"] = [{"type": "text", "text": system}]
|
|
88
89
|
if temperature is not None:
|
|
89
|
-
|
|
90
|
+
request_kwargs["temperature"] = temperature
|
|
90
91
|
if stop_sequences is not None:
|
|
91
|
-
|
|
92
|
+
request_kwargs["stop_sequences"] = stop_sequences
|
|
92
93
|
if top_k is not None:
|
|
93
|
-
|
|
94
|
+
request_kwargs["top_k"] = top_k
|
|
94
95
|
if top_p is not None:
|
|
95
|
-
|
|
96
|
+
request_kwargs["top_p"] = top_p
|
|
96
97
|
|
|
97
98
|
# Call SDK method
|
|
98
99
|
response = self.service.AnthropicModel.messages(
|
|
99
100
|
model_id,
|
|
100
|
-
|
|
101
|
-
preview=preview, # type: ignore
|
|
101
|
+
**request_kwargs, # type: ignore[arg-type,call-overload]
|
|
102
102
|
)
|
|
103
103
|
|
|
104
104
|
return self._serialize_response(response)
|
|
@@ -173,35 +173,35 @@ class LanguageModelsService(BaseService):
|
|
|
173
173
|
... )
|
|
174
174
|
"""
|
|
175
175
|
try:
|
|
176
|
-
# Build
|
|
177
|
-
|
|
176
|
+
# Build SDK kwargs
|
|
177
|
+
request_kwargs: Dict[str, Any] = {
|
|
178
178
|
"messages": messages,
|
|
179
|
-
"
|
|
179
|
+
"max_tokens": max_tokens,
|
|
180
|
+
"preview": preview,
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
# Add optional parameters if provided
|
|
183
184
|
if system is not None:
|
|
184
|
-
|
|
185
|
+
request_kwargs["system"] = system
|
|
185
186
|
if temperature is not None:
|
|
186
|
-
|
|
187
|
+
request_kwargs["temperature"] = temperature
|
|
187
188
|
if thinking is not None:
|
|
188
|
-
|
|
189
|
+
request_kwargs["thinking"] = thinking
|
|
189
190
|
if tools is not None:
|
|
190
|
-
|
|
191
|
+
request_kwargs["tools"] = tools
|
|
191
192
|
if tool_choice is not None:
|
|
192
|
-
|
|
193
|
+
request_kwargs["tool_choice"] = tool_choice
|
|
193
194
|
if stop_sequences is not None:
|
|
194
|
-
|
|
195
|
+
request_kwargs["stop_sequences"] = stop_sequences
|
|
195
196
|
if top_k is not None:
|
|
196
|
-
|
|
197
|
+
request_kwargs["top_k"] = top_k
|
|
197
198
|
if top_p is not None:
|
|
198
|
-
|
|
199
|
+
request_kwargs["top_p"] = top_p
|
|
199
200
|
|
|
200
201
|
# Call SDK method
|
|
201
202
|
response = self.service.AnthropicModel.messages(
|
|
202
203
|
model_id,
|
|
203
|
-
|
|
204
|
-
preview=preview, # type: ignore
|
|
204
|
+
**request_kwargs, # type: ignore[arg-type,call-overload]
|
|
205
205
|
)
|
|
206
206
|
|
|
207
207
|
return self._serialize_response(response)
|
|
@@ -256,22 +256,23 @@ class LanguageModelsService(BaseService):
|
|
|
256
256
|
>>> embeddings = [item['embedding'] for item in response['data']]
|
|
257
257
|
"""
|
|
258
258
|
try:
|
|
259
|
-
# Build
|
|
260
|
-
|
|
259
|
+
# Build SDK kwargs
|
|
260
|
+
request_kwargs: Dict[str, Any] = {
|
|
261
261
|
"input": input_texts,
|
|
262
|
+
"preview": preview,
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
# Add optional parameters if provided
|
|
265
266
|
if dimensions is not None:
|
|
266
|
-
|
|
267
|
+
request_kwargs["dimensions"] = dimensions
|
|
267
268
|
if encoding_format is not None:
|
|
268
|
-
|
|
269
|
+
# CLI accepts "float"/"base64", while SDK expects uppercase literals.
|
|
270
|
+
request_kwargs["encoding_format"] = encoding_format.upper()
|
|
269
271
|
|
|
270
272
|
# Call SDK method
|
|
271
273
|
response = self.service.OpenAiModel.embeddings(
|
|
272
274
|
model_id,
|
|
273
|
-
|
|
274
|
-
preview=preview, # type: ignore
|
|
275
|
+
**request_kwargs, # type: ignore[arg-type,call-overload]
|
|
275
276
|
)
|
|
276
277
|
|
|
277
278
|
return self._serialize_response(response)
|
|
@@ -55,12 +55,12 @@ class TestLanguageModelsService:
|
|
|
55
55
|
assert call_args[0][0] == model_id
|
|
56
56
|
assert call_args[1]["preview"] is False
|
|
57
57
|
|
|
58
|
-
# Check
|
|
59
|
-
request
|
|
60
|
-
assert
|
|
61
|
-
assert len(
|
|
62
|
-
assert
|
|
63
|
-
assert
|
|
58
|
+
# Check SDK kwargs structure
|
|
59
|
+
assert "request" not in call_args[1]
|
|
60
|
+
assert call_args[1]["max_tokens"] == 1024
|
|
61
|
+
assert len(call_args[1]["messages"]) == 1
|
|
62
|
+
assert call_args[1]["messages"][0]["role"] == "user"
|
|
63
|
+
assert call_args[1]["messages"][0]["content"][0]["text"] == message
|
|
64
64
|
|
|
65
65
|
# Check result
|
|
66
66
|
assert result["role"] == "assistant"
|
|
@@ -81,10 +81,9 @@ class TestLanguageModelsService:
|
|
|
81
81
|
|
|
82
82
|
# Assert
|
|
83
83
|
call_args = mock_client.language_models.AnthropicModel.messages.call_args
|
|
84
|
-
|
|
85
|
-
assert "system"
|
|
86
|
-
assert
|
|
87
|
-
assert request["system"][0]["text"] == system
|
|
84
|
+
assert "system" in call_args[1]
|
|
85
|
+
assert call_args[1]["system"][0]["type"] == "text"
|
|
86
|
+
assert call_args[1]["system"][0]["text"] == system
|
|
88
87
|
|
|
89
88
|
def test_send_message_with_all_parameters(self, service, mock_client):
|
|
90
89
|
"""Test sending message with all optional parameters."""
|
|
@@ -110,12 +109,12 @@ class TestLanguageModelsService:
|
|
|
110
109
|
|
|
111
110
|
# Assert
|
|
112
111
|
call_args = mock_client.language_models.AnthropicModel.messages.call_args
|
|
113
|
-
request
|
|
114
|
-
assert
|
|
115
|
-
assert
|
|
116
|
-
assert
|
|
117
|
-
assert
|
|
118
|
-
assert
|
|
112
|
+
assert "request" not in call_args[1]
|
|
113
|
+
assert call_args[1]["max_tokens"] == 500
|
|
114
|
+
assert call_args[1]["temperature"] == 0.7
|
|
115
|
+
assert call_args[1]["stop_sequences"] == ["STOP", "END"]
|
|
116
|
+
assert call_args[1]["top_k"] == 50
|
|
117
|
+
assert call_args[1]["top_p"] == 0.9
|
|
119
118
|
assert call_args[1]["preview"] is True
|
|
120
119
|
|
|
121
120
|
def test_send_message_error(self, service, mock_client):
|
|
@@ -155,9 +154,10 @@ class TestLanguageModelsService:
|
|
|
155
154
|
|
|
156
155
|
# Assert
|
|
157
156
|
call_args = mock_client.language_models.AnthropicModel.messages.call_args
|
|
158
|
-
request
|
|
159
|
-
assert
|
|
160
|
-
assert
|
|
157
|
+
assert "request" not in call_args[1]
|
|
158
|
+
assert call_args[1]["messages"] == messages
|
|
159
|
+
assert call_args[1]["max_tokens"] == max_tokens
|
|
160
|
+
assert call_args[1]["preview"] is False
|
|
161
161
|
assert result["role"] == "assistant"
|
|
162
162
|
|
|
163
163
|
def test_send_messages_advanced_with_thinking(self, service, mock_client):
|
|
@@ -177,8 +177,7 @@ class TestLanguageModelsService:
|
|
|
177
177
|
|
|
178
178
|
# Assert
|
|
179
179
|
call_args = mock_client.language_models.AnthropicModel.messages.call_args
|
|
180
|
-
|
|
181
|
-
assert request["thinking"] == thinking
|
|
180
|
+
assert call_args[1]["thinking"] == thinking
|
|
182
181
|
|
|
183
182
|
def test_send_messages_advanced_with_tools(self, service, mock_client):
|
|
184
183
|
"""Test sending messages with tool calling."""
|
|
@@ -210,9 +209,8 @@ class TestLanguageModelsService:
|
|
|
210
209
|
|
|
211
210
|
# Assert
|
|
212
211
|
call_args = mock_client.language_models.AnthropicModel.messages.call_args
|
|
213
|
-
|
|
214
|
-
assert
|
|
215
|
-
assert request["toolChoice"] == tool_choice
|
|
212
|
+
assert call_args[1]["tools"] == tools
|
|
213
|
+
assert call_args[1]["tool_choice"] == tool_choice
|
|
216
214
|
|
|
217
215
|
def test_send_messages_advanced_error(self, service, mock_client):
|
|
218
216
|
"""Test error handling in send_messages_advanced."""
|
|
@@ -259,7 +257,8 @@ class TestLanguageModelsService:
|
|
|
259
257
|
mock_client.language_models.OpenAiModel.embeddings.assert_called_once()
|
|
260
258
|
call_args = mock_client.language_models.OpenAiModel.embeddings.call_args
|
|
261
259
|
assert call_args[0][0] == model_id
|
|
262
|
-
assert
|
|
260
|
+
assert "request" not in call_args[1]
|
|
261
|
+
assert call_args[1]["input"] == input_texts
|
|
263
262
|
assert call_args[1]["preview"] is False
|
|
264
263
|
assert len(result["data"]) == 1
|
|
265
264
|
assert result["usage"]["totalTokens"] == 2
|
|
@@ -286,7 +285,8 @@ class TestLanguageModelsService:
|
|
|
286
285
|
|
|
287
286
|
# Assert
|
|
288
287
|
call_args = mock_client.language_models.OpenAiModel.embeddings.call_args
|
|
289
|
-
assert
|
|
288
|
+
assert "request" not in call_args[1]
|
|
289
|
+
assert call_args[1]["input"] == input_texts
|
|
290
290
|
assert len(result["data"]) == 3
|
|
291
291
|
|
|
292
292
|
def test_generate_embeddings_with_dimensions(self, service, mock_client):
|
|
@@ -308,8 +308,7 @@ class TestLanguageModelsService:
|
|
|
308
308
|
|
|
309
309
|
# Assert
|
|
310
310
|
call_args = mock_client.language_models.OpenAiModel.embeddings.call_args
|
|
311
|
-
|
|
312
|
-
assert request["dimensions"] == dimensions
|
|
311
|
+
assert call_args[1]["dimensions"] == dimensions
|
|
313
312
|
|
|
314
313
|
def test_generate_embeddings_with_encoding_format(self, service, mock_client):
|
|
315
314
|
"""Test generating embeddings with base64 encoding."""
|
|
@@ -332,8 +331,7 @@ class TestLanguageModelsService:
|
|
|
332
331
|
|
|
333
332
|
# Assert
|
|
334
333
|
call_args = mock_client.language_models.OpenAiModel.embeddings.call_args
|
|
335
|
-
|
|
336
|
-
assert request["encodingFormat"] == encoding_format
|
|
334
|
+
assert call_args[1]["encoding_format"] == "BASE64"
|
|
337
335
|
|
|
338
336
|
def test_generate_embeddings_with_all_parameters(self, service, mock_client):
|
|
339
337
|
"""Test generating embeddings with all optional parameters."""
|
|
@@ -359,10 +357,9 @@ class TestLanguageModelsService:
|
|
|
359
357
|
|
|
360
358
|
# Assert
|
|
361
359
|
call_args = mock_client.language_models.OpenAiModel.embeddings.call_args
|
|
362
|
-
|
|
363
|
-
assert
|
|
364
|
-
assert
|
|
365
|
-
assert request["encodingFormat"] == "float"
|
|
360
|
+
assert call_args[1]["input"] == input_texts
|
|
361
|
+
assert call_args[1]["dimensions"] == 512
|
|
362
|
+
assert call_args[1]["encoding_format"] == "FLOAT"
|
|
366
363
|
assert call_args[1]["preview"] is True
|
|
367
364
|
|
|
368
365
|
def test_generate_embeddings_error(self, service, mock_client):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.14.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|