Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ scenario = ai_api_v2_client.scenario.get(scenario_id="<SCENARIO_ID>")
The [unit tests](tests) are simply python unit tests. They can be run via pytest or directly from IDE.

The [integration_tests](integration_tests) are also python tests. They run against intwdf cluster.


Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ def test_query_resource_group_search_case_insensitive(self):
self.assertEqual(expected_response.count, response.count)
self.assertEqual(len(expected_response.resources), len(response.resources))

self.assert_resource_group(expected_response.resources[0], response.resources[0])
self.assert_resource_group(expected_response.resources[0], response.resources[0])
2 changes: 1 addition & 1 deletion packages/core/ai_core_sdk/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
class Timeouts(Enum):
READ_TIMEOUT = 60
CONNECT_TIMEOUT = 60
NUM_REQUEST_RETRIES = 3
NUM_REQUEST_RETRIES = 3
2 changes: 1 addition & 1 deletion packages/core/integration_tests/test_e2e_x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def test_x509_file_path(self):
def test_x509_str(self):
client = AICoreV2Client(base_url=BASE_URL, auth_url=X509_CERT_URL, client_id=CLIENT_ID, cert_str=X509_CERT_STR,
key_str=X509_KEY_STR, resource_group=RESOURCE_GROUP_ID)
self._query_and_assert_scenarios(client)
self._query_and_assert_scenarios(client)
2 changes: 1 addition & 1 deletion packages/core/tests/helpers/test_base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def test_message_string_representation(self):
message = "dummy_message"
message_object = Message(message=message)
self.assertIn("Message: ", message_object.__str__())
self.assertIn(message, message_object.__str__())
self.assertIn(message, message_object.__str__())
2 changes: 1 addition & 1 deletion packages/core/tests/tracking/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ def test_tracking_query_metrics_within_aicore(self):

def test_tracking_authenticator_exception(self):
with self.assertRaises(AIAPIAuthenticatorException):
self.tracking = Tracking('http://test_url')
self.tracking = Tracking('http://test_url')
Binary file modified packages/gen/AICORE.generative-ai-hub-sdk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/gen/GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ High quality documentation is as important as the shipped code. **Developer docu

Collaboration, creativity, and meaningful innovation depend on good communication. To make your contribution a success, be open and transparent about your planned development and closely align with the project team. Use communication tools that allow anyone to easily find discussions that happened in the past.

To contact us or get in touch with our community, please have a look at our [communication channels](SUPPORT.md#communication-channels).
To contact us or get in touch with our community, please have a look at our [communication channels](SUPPORT.md#communication-channels).
2 changes: 1 addition & 1 deletion packages/gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ This project is Innersource and if you wish to contribute to this project please

The code for this SDK is originated from [llm-commons](https://github.tools.sap/AI-Playground-Projects/llm-commons).

Kudos to the authors (especially Mathis Börner).
Kudos to the authors (especially Mathis Börner).
2 changes: 1 addition & 1 deletion packages/gen/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Within the project we are using these communication channels:
- Issues: [GitHub](https://github.wdf.sap.corp/AI/generative-ai-hub-sdk/issues)
- Chat: [Slack](#ai-core-sdk)
- Team: [Contributors](https://github.wdf.sap.corp/AI/generative-ai-hub-sdk/graphs/contributors)
- Planning: [Jira](https://jira.tools.sap/browse/AI-33952)
- Planning: [Jira](https://jira.tools.sap/browse/AI-33952)
2 changes: 1 addition & 1 deletion packages/gen/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ comment_out_lines:
sed -i '' '/window\.location/s/^/\/\/ /' ./build/html/_static/doctools.js; \
else \
sed -i '/window\.location/s/^/\/\/ /' ./build/html/_static/doctools.js; \
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
2 changes: 1 addition & 1 deletion packages/gen/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ SAP Cloud SDK for AI (Python) - generative
Introduction <./_reference/README_sphynx.md>
examples
Release Notes <./_reference/RELEASE_NOTES.md>
API Reference <./_api_doc/gen_ai_hub.rst>
API Reference <./_api_doc/gen_ai_hub.rst>
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/document_grounding/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
"RetrievalAPIClient",
"VectorAPIClient"

]
]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/document_grounding/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
"PipelineAPIClient",
"RetrievalAPIClient",
"VectorAPIClient",
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
__all__ = [
"PipelineAPIClient", "RetrievalAPIClient", "VectorAPIClient", "PATH_DOCUMENT_GROUNDING",
"PATH_DOCUMENT_GROUNDING_VECTOR", "PATH_DOCUMENT_GROUNDING_PIPELINES", "PATH_DOCUMENT_GROUNDING_RETRIEVAL"
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@
"DocumentsChunk",
"VectorPerFilterSearchResult",
"VectorSearchResults"
]
]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/evaluations/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,4 @@
TRACKING_SERVICE_ENDPOINT = "/lm/metrics"
CONTENT_TYPE = "application/json"
DEFAULT_TIMEOUT = 3600
ADDITIONAL_INFO_KEY = "additional_info"
ADDITIONAL_INFO_KEY = "additional_info"
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/evaluations/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .artifact_source import ArtifactSource
from .evaluation_run import Results, EvaluationRun

__all__ = ["Dataset", "EvaluationConfig", "MetricConfig", "MetricRef", "ArtifactSource", "Results", "EvaluationRun"]
__all__ = ["Dataset", "EvaluationConfig", "MetricConfig", "MetricRef", "ArtifactSource", "Results", "EvaluationRun"]
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ def __init__(
self.path = path
self.file_type = file_type

__all__ = ["ArtifactSource"]
__all__ = ["ArtifactSource"]
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ def file_type(self) -> Optional[str]:

return SUFFIX_TO_FILE_TYPE.get(suffix, None)

__all__ = ["Dataset"]
__all__ = ["Dataset"]
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ def __init__(
self.repetitions = repetitions
self.debug_mode = debug_mode

__all__ = ["EvaluationConfig"]
__all__ = ["EvaluationConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def __init__(
self.reference = reference
self.variable_mapping = variable_mapping

__all__ = ["MetricRef", "MetricConfig"]
__all__ = ["MetricRef", "MetricConfig"]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/evaluations/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ def read_local_csv_file(file_path: Path, error_collector: ValidationCollector) -
error_collector.add_error(
ErrorCode.GENERIC_ERROR, f"Reading config file {file_path} failed with: {e}"
)
return []
return []
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ def validate_name(name):
"or contain underscores and dashes, with a maximum length of 64.")

return name


2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/orchestration_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@

# Exceptions
"OrchestrationError", "OrchestrationErrorList"
]
]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/orchestration_v2/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def __init__(self, errors: list[OrchestrationError]):
super().__init__(errors[0].message)


__all__ = ["OrchestrationError", "OrchestrationErrorList"]
__all__ = ["OrchestrationError", "OrchestrationErrorList"]
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@
"TranslationConfig", "SAPDocumentTranslation", "SAPDocumentTranslationApplyToSelector",
"InputTranslationConfig", "OutputTranslationConfig", "SAPDocumentTranslationInput",
"SAPDocumentTranslationOutput", "TranslationModuleConfig"
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ class AzureContentSafetyOutput(AzureContentFilter):

protected_material_code: Optional[bool] = False

__all__ = ["AzureContentFilter", "AzureContentSafetyInput", "AzureContentSafetyOutput", "AzureThreshold"]
__all__ = ["AzureContentFilter", "AzureContentSafetyInput", "AzureContentSafetyOutput", "AzureThreshold"]
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef(Base

__all__ = ["ModuleConfig", "OrchestrationConfig", "OrchestrationConfigReference",
"CompletionRequestConfigurationReferenceByIdConfigRef",
"CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef"]
"CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef"]
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ class FilteringStreamOptions(BaseModel):
overlap: Optional[int] = Field(default=0, ge=0, le=10000)

__all__ = ["ContentFilterProvider", "ContentFilter", "LlamaGuard38bFilterConfig", "AzureContentSafetyInputFilterConfig",
"AzureContentSafetyOutputFilterConfig", "FilteringStreamOptions"]
"AzureContentSafetyOutputFilterConfig", "FilteringStreamOptions"]
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def enforce_min_properties(cls, values): # pylint: disable=no-self-argument
"FilteringModuleConfig must have at least one property: input or output."
return values

__all__ = ["InputFiltering", "OutputFiltering", "FilteringModuleConfig"]
__all__ = ["InputFiltering", "OutputFiltering", "FilteringModuleConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ def enforce_exactly_one_provider_list(self):
return self

__all__ = ["DataMaskingProviderName", "MaskingMethod", "ProfileEntity", "DPIMethodConstant", "DPIMethodFabricatedData",
"DPICustomEntity", "DPIStandardEntity", "MaskGroundingInput", "MaskingProviderConfig", "MaskingModuleConfig"]
"DPICustomEntity", "DPIStandardEntity", "MaskGroundingInput", "MaskingProviderConfig", "MaskingModuleConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ class GroundingModuleConfig(BaseModel):
config: DocumentGroundingConfig

__all__ = ["GroundingType", "DataRepositoryType", "DocumentGroundingFilter", "DocumentGroundingPlaceholders",
"DocumentGroundingConfig", "GroundingModuleConfig", "KeyValueListPair", "DocumentMetadataKeyValueListPairs"]
"DocumentGroundingConfig", "GroundingModuleConfig", "KeyValueListPair", "DocumentMetadataKeyValueListPairs"]
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ class EmbeddingsRequest(BaseModel):

__all__ = ["EmbeddingsEncodingFormat", "EmbeddingsInputType", "EmbeddingsModelParams", "EmbeddingsModelDetails",
"EmbeddingsModelConfig", "EmbeddingsModuleConfigs", "EmbeddingsOrchestrationConfig", "EmbeddingsInput",
"EmbeddingsUsage", "EmbeddingResult", "EmbeddingsResponse", "EmbeddingsPostResponse", "EmbeddingsRequest"]
"EmbeddingsUsage", "EmbeddingResult", "EmbeddingsResponse", "EmbeddingsPostResponse", "EmbeddingsRequest"]
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ class LlamaGuard38bFilter(BaseModel):
elections: bool = False
code_interpreter_abuse: bool = False

__all__ = ["LlamaGuard38bFilter"]
__all__ = ["LlamaGuard38bFilter"]
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ class LLMModelDetails(BaseModel):
timeout: Optional[int] = Field(default=600, ge=1, le=600)
max_retries: Optional[int] = Field(default=2, ge=0, le=5)

__all__ = ["LLMModelDetails"]
__all__ = ["LLMModelDetails"]
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ class ResponseChatMessage(BaseModel):
ResponseChatMessage]

__all__ = ["Role", "SystemMessage", "UserMessage", "AssistantMessage", "ToolChatMessage", "DeveloperChatMessage",
"ChatMessage", "ResponseChatMessage", "FunctionCall", "MessageToolCall"]
"ChatMessage", "ResponseChatMessage", "FunctionCall", "MessageToolCall"]
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ def model_dump( # pylint: disable=arguments-differ
serialize_as_any=serialize_as_any,
)

__all__ = ["ImageDetailLevel", "TextPart", "ImageUrl", "ImagePart", "ContentPart", "ImageItem"]
__all__ = ["ImageDetailLevel", "TextPart", "ImageUrl", "ImagePart", "ContentPart", "ImageItem"]
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def validate_config_or_ref(self):
)
return self

__all__ = ["CompletionPostRequest"]
__all__ = ["CompletionPostRequest"]
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,4 @@ class OrchestrationResponseWithRetries(CompletionPostResponse):
"StreamCompletionPostResponse",
"ErrorResponse",
"ErrorResponseStreaming",
"OrchestrationResponseWithRetries"]
"OrchestrationResponseWithRetries"]
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ class ResponseFormatJsonSchema(BaseModel):
json_schema: JSONResponseSchema

__all__ = ["ResponseFormatType", "ResponseFormatText", "ResponseFormatJsonObject", "ResponseFormatJsonSchema",
"JSONResponseSchema"]
"JSONResponseSchema"]
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ def model_dump(self, **kwargs):
data.pop('delimiters', None)
return data

__all__ = ["GlobalStreamOptions"]
__all__ = ["GlobalStreamOptions"]
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ class PromptTemplatingModuleConfig(BaseModel):
prompt: Template | TemplateRef
model: LLMModelDetails

__all__ = ["Template", "PromptTemplatingModuleConfig"]
__all__ = ["Template", "PromptTemplatingModuleConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ class TemplateRefByScenarioNameVersion(BaseModel):
class TemplateRef(BaseModel):
template_ref: TemplateRefByID | TemplateRefByScenarioNameVersion

__all__ = ["TemplateRef", "TemplateRefByID", "TemplateRefByScenarioNameVersion"]
__all__ = ["TemplateRef", "TemplateRefByID", "TemplateRefByScenarioNameVersion"]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/orchestration_v2/models/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ def decorator(func_: Callable) -> FunctionTool:
"FunctionObject",
"FunctionTool",
"function_tool"
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ class TranslationModuleConfig(BaseModel):

__al__ = ["TranslationType", "TranslationConfig", "SAPDocumentTranslation", "SAPDocumentTranslationApplyToSelector",
"InputTranslationConfig", "OutputTranslationConfig", "SAPDocumentTranslationInput",
"SAPDocumentTranslationOutput", "TranslationModuleConfig"]
"SAPDocumentTranslationOutput", "TranslationModuleConfig"]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/orchestration_v2/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,4 +813,4 @@ async def aclose_http_connection(self):
await self.async_client.aclose()


__all__ = ["OrchestrationService"]
__all__ = ["OrchestrationService"]
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/prompt_registry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
'PromptTemplateSubstitutionResponse', 'PromptTemplateGetResponse', 'PromptTemplatePostResponse',
'PromptTemplateDeleteResponse', 'PromptTemplateListResponse', 'OrchestrationConfigPostRequest',
'OrchestrationConfigPostResponse', 'OrchestrationConfigGetResponse', 'OrchestrationConfigListResponse',
'OrchestrationConfigDeleteResponse']
'OrchestrationConfigDeleteResponse']
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/prompt_registry/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,4 @@ def export_orchestration_config(self, config_id: str) -> bytes:

return response

__all__ = ["PromptTemplateClient", "OrchestrationConfigClient"]
__all__ = ["PromptTemplateClient", "OrchestrationConfigClient"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
'PromptTemplateSubstitutionResponse', 'PromptTemplateGetResponse', 'PromptTemplatePostResponse',
'PromptTemplateDeleteResponse', 'PromptTemplateListResponse', 'OrchestrationConfigPostRequest',
'OrchestrationConfigPostResponse', 'OrchestrationConfigGetResponse', 'OrchestrationConfigListResponse',
'OrchestrationConfigDeleteResponse']
'OrchestrationConfigDeleteResponse']
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/proxy/native/amazon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ClientWrapper, Session, AsyncSession, AsyncClientWrapper)

__all__ = ["set_deployment", "get_current_deployment","prepare_request_dict", "tolerate_missing_model_id",
"ClientWrapper", "Session", "AsyncSession", "AsyncClientWrapper"]
"ClientWrapper", "Session", "AsyncSession", "AsyncClientWrapper"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .clients import Client, AICoreDynamicTransport, AsyncAICoreDynamicTransport

__all__ = ['Client', 'AICoreDynamicTransport', 'AsyncAICoreDynamicTransport']
__all__ = ['Client', 'AICoreDynamicTransport', 'AsyncAICoreDynamicTransport']
2 changes: 1 addition & 1 deletion packages/gen/gen_ai_hub/proxy/native/sap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
PredictionItem, PredictionConfig, ErrorResponseDetails, DataType)

__all__ = ['RPTClient', 'TargetColumn', 'RPTRequest', 'RPTResponse', 'RPTException', 'ResponseStatus',
'ResponseMetadata', 'Prediction', 'PredictionItem', 'PredictionConfig', 'ErrorResponseDetails', 'DataType']
'ResponseMetadata', 'Prediction', 'PredictionItem', 'PredictionConfig', 'ErrorResponseDetails', 'DataType']
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ def test_search_pipelines(self):
)
response = self.client.search_pipelines(request)
self.assertIsInstance(response, SearchPipelinesResponse)
self.assertGreaterEqual(response.count, 0)
self.assertGreaterEqual(response.count, 0)
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,4 @@ def test_integration(self):
# Verify deletion status after deletion.
self.assertTrue(self.__class__.collection_id)
response = self.client.get_collection_deletion_status(self.__class__.collection_id)
self.assertIn(response.status, ["DELETED", "PENDING"])
self.assertIn(response.status, ["DELETED", "PENDING"])
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ async def test_apredict_by_columns(self):
self.assertEqual(response.metadata.num_columns, 5)
self.assertEqual(response.metadata.num_predictions, 1)
self.assertIn("COSTCENTER", response.predictions[0].model_dump())
self.assertNotIn("ID", response.predictions[0].model_dump())
self.assertNotIn("ID", response.predictions[0].model_dump())
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@ def test_blocked_input_filtering_with_azure_and_llama(self):
config = OrchestrationConfig(modules=module_config)

with self.assertRaises(OrchestrationError):
self.service.run(config=config)
self.service.run(config=config)
Loading