Skip to content

Commit ccbc5e0

Browse files
committed
Version 1.4.56
1 parent 303c449 commit ccbc5e0

File tree

335 files changed

+5008
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+5008
-165
lines changed

abacusai/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
from .hosted_database import HostedDatabase
141141
from .hosted_database_snapshot import HostedDatabaseSnapshot
142142
from .hosted_model_token import HostedModelToken
143+
from .hostname_info import HostnameInfo
143144
from .hume_voice import HumeVoice
144145
from .image_gen_model import ImageGenModel
145146
from .image_gen_model_options import ImageGenModelOptions
@@ -151,6 +152,7 @@
151152
from .lip_sync_gen_settings import LipSyncGenSettings
152153
from .llm_app import LlmApp
153154
from .llm_artifact import LlmArtifact
155+
from .llm_artifact_conversation import LlmArtifactConversation
154156
from .llm_code_block import LlmCodeBlock
155157
from .llm_execution_preview import LlmExecutionPreview
156158
from .llm_execution_result import LlmExecutionResult
@@ -160,6 +162,8 @@
160162
from .llm_response import LlmResponse
161163
from .mcp_config import McpConfig
162164
from .mcp_server import McpServer
165+
from .mcp_server_connection import McpServerConnection
166+
from .mcp_server_query_result import McpServerQueryResult
163167
from .memory_options import MemoryOptions
164168
from .messaging_connector_response import MessagingConnectorResponse
165169
from .model import Model
@@ -273,4 +277,4 @@
273277
from .workflow_node_template import WorkflowNodeTemplate
274278

275279

276-
__version__ = "1.4.55"
280+
__version__ = "1.4.56"

abacusai/api_class/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __post_init__(self):
6464
if self.document_type is not None:
6565
if DocumentType.is_ocr_forced(self.document_type):
6666
self.highlight_relevant_text = True
67-
else:
67+
elif self.highlight_relevant_text is None:
6868
self.highlight_relevant_text = False
6969
if self.highlight_relevant_text is not None:
7070
self.extract_bounding_boxes = self.highlight_relevant_text # Highlight_relevant text acts as a wrapper over extract_bounding_boxes

abacusai/api_class/enums.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ class ApplicationConnectorType(ApiEnum):
418418
OAUTH = 'OAUTH'
419419
SALESFORCE = 'SALESFORCE'
420420
TWITTER = 'TWITTER'
421+
MCP = 'MCP'
421422

422423
@classmethod
423424
def user_connectors(cls):
@@ -430,7 +431,8 @@ def user_connectors(cls):
430431
cls.ONEDRIVE,
431432
cls.SALESFORCE,
432433
cls.TWITTER,
433-
cls.SHAREPOINT
434+
cls.SHAREPOINT,
435+
cls.CONFLUENCE
434436
]
435437

436438
@classmethod

abacusai/api_class/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class ChatLLMTrainingConfig(TrainingConfig):
501501
json_response_schema (str): Specifies the JSON schema that the model should adhere to if `response_format` is set to "JSON". This should be a json-formatted string where each field of the expected schema is mapped to a dictionary containing the fields 'type', 'required' and 'description'. For example - '{"sample_field": {"type": "integer", "required": true, "description": "Sample Field"}}'
502502
mask_pii (bool): Mask PII in the prompts and uploaded documents before sending it to the LLM.
503503
builtin_tools (List[SystemConnectorTool]): List of builtin system connector tools to use in the ChatLLM. Using builtin tools does not require enabling tool bar (enable_tool_bar flag).
504-
mcp_server_configs (str): JSON string of MCP servers configs to use in the ChatLLM model. This should not be used with document_retrievers.
504+
mcp_servers (List[str]): List of names of MCP servers to use in the ChatLLM. This should not be used with document_retrievers.
505505
"""
506506
document_retrievers: List[str] = dataclasses.field(default=None)
507507
num_completion_tokens: int = dataclasses.field(default=None)
@@ -540,7 +540,7 @@ class ChatLLMTrainingConfig(TrainingConfig):
540540
json_response_schema: str = dataclasses.field(default=None)
541541
mask_pii: bool = dataclasses.field(default=None)
542542
builtin_tools: List[SystemConnectorTool] = dataclasses.field(default=None)
543-
mcp_server_configs: str = dataclasses.field(default=None)
543+
mcp_servers: List[str] = dataclasses.field(default=None)
544544

545545
def __post_init__(self):
546546
self.problem_type = enums.ProblemType.CHAT_LLM

abacusai/client.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
from .llm_generated_code import LlmGeneratedCode
127127
from .llm_input import LlmInput
128128
from .llm_response import LlmResponse
129+
from .mcp_server_query_result import McpServerQueryResult
129130
from .model import Model
130131
from .model_artifacts_export import ModelArtifactsExport
131132
from .model_metrics import ModelMetrics
@@ -662,7 +663,7 @@ class BaseApiClient:
662663
client_options (ClientOptions): Optional API client configurations
663664
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
664665
"""
665-
client_version = '1.4.55'
666+
client_version = '1.4.56'
666667

667668
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
668669
self.api_key = api_key
@@ -1611,6 +1612,16 @@ def get_user_connector_auth(self, service: Union[ApplicationConnectorType, str],
16111612
UnifiedConnector: The application connector with the authentication details."""
16121613
return self._call_api('getUserConnectorAuth', 'GET', query_params={'service': service, 'scopes': scopes}, parse_type=UnifiedConnector)
16131614

1615+
def get_user_mcp_connector_auth(self, mcp_server_name: str = None) -> ApplicationConnector:
1616+
"""Get the auth for a MCP connector
1617+
1618+
Args:
1619+
mcp_server_name (str): The name of the MCP server
1620+
1621+
Returns:
1622+
ApplicationConnector: The MCP connector"""
1623+
return self._call_api('getUserMcpConnectorAuth', 'GET', query_params={'mcpServerName': mcp_server_name}, parse_type=ApplicationConnector)
1624+
16141625
def list_streaming_connectors(self) -> List[StreamingConnector]:
16151626
"""Retrieves a list of all streaming connectors along with their corresponding attributes.
16161627

@@ -8970,7 +8981,7 @@ def delete_external_application(self, external_application_id: str):
89708981
external_application_id (str): The ID of the External Application."""
89718982
return self._call_api('deleteExternalApplication', 'DELETE', query_params={'externalApplicationId': external_application_id})
89728983

8973-
def create_agent(self, project_id: str, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = AgentInterface.DEFAULT, included_modules: List = None, org_level_connectors: List = None, user_level_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None, agent_mcp_config: dict = None) -> Agent:
8984+
def create_agent(self, project_id: str, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = AgentInterface.DEFAULT, included_modules: List = None, org_level_connectors: List = None, user_level_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
89748985
"""Creates a new AI agent using the given agent workflow graph definition.
89758986

89768987
Args:
@@ -8987,13 +8998,12 @@ def create_agent(self, project_id: str, function_source_code: str = None, agent_
89878998
user_level_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific user level application connector, while the value is a list of scopes that define the permissions granted to the application.
89888999
initialize_function_name (str): The name of the function to be used for initialization.
89899000
initialize_function_code (str): The function code to be used for initialization.
8990-
agent_mcp_config (dict): The MCP config for the agent.
89919001

89929002
Returns:
89939003
Agent: The new agent."""
8994-
return self._call_api('createAgent', 'POST', query_params={}, body={'projectId': project_id, 'functionSourceCode': function_source_code, 'agentFunctionName': agent_function_name, 'name': name, 'memory': memory, 'packageRequirements': package_requirements, 'description': description, 'enableBinaryInput': enable_binary_input, 'evaluationFeatureGroupId': evaluation_feature_group_id, 'agentInputSchema': agent_input_schema, 'agentOutputSchema': agent_output_schema, 'workflowGraph': workflow_graph, 'agentInterface': agent_interface, 'includedModules': included_modules, 'orgLevelConnectors': org_level_connectors, 'userLevelConnectors': user_level_connectors, 'initializeFunctionName': initialize_function_name, 'initializeFunctionCode': initialize_function_code, 'agentMcpConfig': agent_mcp_config}, parse_type=Agent)
9004+
return self._call_api('createAgent', 'POST', query_params={}, body={'projectId': project_id, 'functionSourceCode': function_source_code, 'agentFunctionName': agent_function_name, 'name': name, 'memory': memory, 'packageRequirements': package_requirements, 'description': description, 'enableBinaryInput': enable_binary_input, 'evaluationFeatureGroupId': evaluation_feature_group_id, 'agentInputSchema': agent_input_schema, 'agentOutputSchema': agent_output_schema, 'workflowGraph': workflow_graph, 'agentInterface': agent_interface, 'includedModules': included_modules, 'orgLevelConnectors': org_level_connectors, 'userLevelConnectors': user_level_connectors, 'initializeFunctionName': initialize_function_name, 'initializeFunctionCode': initialize_function_code}, parse_type=Agent)
89959005

8996-
def update_agent(self, model_id: str, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = None, included_modules: List = None, org_level_connectors: List = None, user_level_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None, agent_mcp_config: dict = None) -> Agent:
9006+
def update_agent(self, model_id: str, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = None, included_modules: List = None, org_level_connectors: List = None, user_level_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
89979007
"""Updates an existing AI Agent. A new version of the agent will be created and published.
89989008

89999009
Args:
@@ -9008,11 +9018,10 @@ def update_agent(self, model_id: str, function_source_code: str = None, agent_fu
90089018
user_level_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific user level application connector, while the value is a list of scopes that define the permissions granted to the application.
90099019
initialize_function_name (str): The name of the function to be used for initialization.
90109020
initialize_function_code (str): The function code to be used for initialization.
9011-
agent_mcp_config (dict): The MCP config for the agent.
90129021

90139022
Returns:
90149023
Agent: The updated agent."""
9015-
return self._call_api('updateAgent', 'POST', query_params={}, body={'modelId': model_id, 'functionSourceCode': function_source_code, 'agentFunctionName': agent_function_name, 'memory': memory, 'packageRequirements': package_requirements, 'description': description, 'enableBinaryInput': enable_binary_input, 'agentInputSchema': agent_input_schema, 'agentOutputSchema': agent_output_schema, 'workflowGraph': workflow_graph, 'agentInterface': agent_interface, 'includedModules': included_modules, 'orgLevelConnectors': org_level_connectors, 'userLevelConnectors': user_level_connectors, 'initializeFunctionName': initialize_function_name, 'initializeFunctionCode': initialize_function_code, 'agentMcpConfig': agent_mcp_config}, parse_type=Agent)
9024+
return self._call_api('updateAgent', 'POST', query_params={}, body={'modelId': model_id, 'functionSourceCode': function_source_code, 'agentFunctionName': agent_function_name, 'memory': memory, 'packageRequirements': package_requirements, 'description': description, 'enableBinaryInput': enable_binary_input, 'agentInputSchema': agent_input_schema, 'agentOutputSchema': agent_output_schema, 'workflowGraph': workflow_graph, 'agentInterface': agent_interface, 'includedModules': included_modules, 'orgLevelConnectors': org_level_connectors, 'userLevelConnectors': user_level_connectors, 'initializeFunctionName': initialize_function_name, 'initializeFunctionCode': initialize_function_code}, parse_type=Agent)
90169025

90179026
def generate_agent_code(self, project_id: str, prompt: str, fast_mode: bool = None) -> list:
90189027
"""Generates the code for defining an AI Agent
@@ -9257,3 +9266,17 @@ def get_relevant_snippets(self, doc_ids: List = None, blobs: io.TextIOBase = Non
92579266
Returns:
92589267
list[DocumentRetrieverLookupResult]: The snippets found from the documents."""
92599268
return self._proxy_request('GetRelevantSnippets', 'POST', query_params={}, data={'docIds': doc_ids, 'query': query, 'documentRetrieverConfig': json.dumps(document_retriever_config.to_dict()) if hasattr(document_retriever_config, 'to_dict') else json.dumps(document_retriever_config), 'honorSentenceBoundary': honor_sentence_boundary, 'numRetrievalMarginWords': num_retrieval_margin_words, 'maxWordsPerSnippet': max_words_per_snippet, 'maxSnippetsPerDocument': max_snippets_per_document, 'startWordIndex': start_word_index, 'endWordIndex': end_word_index, 'includingBoundingBoxes': including_bounding_boxes, 'text': text, 'documentProcessingConfig': json.dumps(document_processing_config.to_dict()) if hasattr(document_processing_config, 'to_dict') else json.dumps(document_processing_config)}, files=blobs, parse_type=DocumentRetrieverLookupResult)
9269+
9270+
def query_mcp_server(self, task: str, server_name: str) -> McpServerQueryResult:
9271+
"""Query a Remote MCP server. For a given task, it runs the required tools of the MCP
9272+
9273+
server with appropriate arguments and returns the output.
9274+
9275+
9276+
Args:
9277+
task (str): a comprehensive description of the task to perform using the MCP server tools.
9278+
server_name (str): The name of the MCP server.
9279+
9280+
Returns:
9281+
McpServerQueryResult: The execution logs as well as the final output of the task execution."""
9282+
return self._proxy_request('QueryMcpServer', 'POST', query_params={}, body={'task': task, 'serverName': server_name}, parse_type=McpServerQueryResult)

0 commit comments

Comments
 (0)