MCPcopy
hub / github.com/Agenta-AI/agenta / create_workspace

Method create_workspace

sdk/agenta/client/client.py:944–1021  ·  view source on GitHub ↗

Parameters ---------- org_id : str name : str description : typing.Optional[str] type : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns -------

(
        self,
        org_id: str,
        *,
        name: str,
        description: typing.Optional[str] = OMIT,
        type: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    )

Source from the content-addressed store, hash-verified

942 raise ApiError(status_code=_response.status_code, body=_response_json)
943
944 def create_workspace(
945 self,
946 org_id: str,
947 *,
948 name: str,
949 description: typing.Optional[str] = OMIT,
950 type: typing.Optional[str] = OMIT,
951 request_options: typing.Optional[RequestOptions] = None,
952 ) -> WorkspaceResponse:
953 """
954 Parameters
955 ----------
956 org_id : str
957
958 name : str
959
960 description : typing.Optional[str]
961
962 type : typing.Optional[str]
963
964 request_options : typing.Optional[RequestOptions]
965 Request-specific configuration.
966
967 Returns
968 -------
969 WorkspaceResponse
970 Successful Response
971
972 Examples
973 --------
974 from agenta import AgentaApi
975
976 client = AgentaApi(
977 api_key="YOUR_API_KEY",
978 base_url="https://yourhost.com/path/to/api",
979 )
980 client.create_workspace(
981 org_id="org_id",
982 name="name",
983 )
984 """
985 _response = self._client_wrapper.httpx_client.request(
986 f"organizations/{jsonable_encoder(org_id)}/workspaces",
987 method="POST",
988 json={
989 "name": name,
990 "description": description,
991 "type": type,
992 },
993 headers={
994 "content-type": "application/json",
995 },
996 request_options=request_options,
997 omit=OMIT,
998 )
999 try:
1000 if 200 <= _response.status_code < 300:
1001 return typing.cast(

Callers

nothing calls this directly

Calls 6

jsonable_encoderFunction · 0.90
parse_obj_asFunction · 0.85
jsonMethod · 0.80
ApiErrorClass · 0.50
requestMethod · 0.45

Tested by

no test coverage detected