Skip to content

memas-ai/MeMaS-python-client

Repository files navigation

memas-client

This is the Data Plane client for MeMaS (Memory Management Service). See https://github.com/memas-ai/MeMaS for more details.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.1
  • Package version: 0.1.5
  • 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/memas-ai/MeMaS-python-client.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/memas-ai/MeMaS-python-client.git)

Then import the package:

import memas_client

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_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import memas_client
from pprint import pprint
from memas_client.apis.tags import dp_api
from memas_client.model.cited_document import CitedDocument
from memas_client.model.namespace_does_not_exist_error import NamespaceDoesNotExistError
from memas_client.model.namespace_illegal_name_error import NamespaceIllegalNameError
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = memas_client.Configuration(
    host = "http://localhost"
)


# Enter a context with an instance of the API client
with memas_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dp_api.DpApi(api_client)
    any_type = None # anyType | Request object for memorizing a document

    try:
        # Memorize information
        api_response = api_instance.memorize(any_type)
        pprint(api_response)
    except memas_client.ApiException as e:
        print("Exception when calling DpApi->memorize: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
DpApi memorize post /dp/memorize Memorize information
DpApi recall post /dp/recall Recalls information

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

max.yu@memas.ai

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in memas_client.apis and memas_client.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_client.apis.default_api import DefaultApi
  • from memas_client.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_client
from memas_client.apis import *
from memas_client.models import *