memas-sdk
This is the Control Plane client for MeMaS (Memory Management Service). Go to https://github.com/memas-ai/MeMaS for more info.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 0.1.0
- Package version: 0.1.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python >=3.7
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import memas_sdk
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import memas_sdk
Getting Started
Please follow the installation procedure and then run the following:
import time
import memas_sdk
from pprint import pprint
from memas_sdk.apis.tags import cp_api
from memas_sdk.model.corpus_type import CorpusType
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = memas_sdk.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with memas_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cp_api.CpApi(api_client)
any_type = dict(
corpus_pathname="memas.wikipedia",
corpus_type=CorpusType("knowledge"),
) # anyType |
try:
# Create corpus
api_response = api_instance.create_corpus(any_type)
pprint(api_response)
except memas_sdk.ApiException as e:
print("Exception when calling CpApi->create_corpus: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
CpApi | create_corpus | post /cp/create_corpus | Create corpus |
CpApi | create_user | post /cp/create_user | Create user |
Documentation For Models
Documentation For Authorization
Endpoints do not require authorization.
Author
Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in memas_sdk.apis and memas_sdk.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from memas_sdk.apis.default_api import DefaultApi
from memas_sdk.model.pet import Pet
Solution 1: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import memas_sdk
from memas_sdk.apis import *
from memas_sdk.models import *