Skip to content

Latest commit

 

History

History
664 lines (448 loc) · 21.7 KB

File metadata and controls

664 lines (448 loc) · 21.7 KB

cms_client.OperationsCompatibleWithOllamaAPIsApi

All URIs are relative to http://localhost

Method HTTP request Description
ollama_chat POST /ollama/api/chat Ollama Chat
ollama_embed POST /ollama/api/embed Ollama Embed
ollama_generate POST /ollama/api/generate Ollama Generate
ollama_health_get GET /ollama/ Ollama Health Get
ollama_health_head HEAD /ollama/ Ollama Health Head
ollama_list_tags GET /ollama/api/tags Ollama List Tags
ollama_show_model POST /ollama/api/show Ollama Show Model
ollama_version GET /ollama/api/version Ollama Version

ollama_chat

object ollama_chat(ollama_chat_request, ensure_full_sentences=ensure_full_sentences, chat_template=chat_template)

Ollama Chat

Generate a chat completion, similar to Ollama's /api/chat endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.ollama_chat_request import OllamaChatRequest
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)
    ollama_chat_request = cms_client.OllamaChatRequest() # OllamaChatRequest | 
    ensure_full_sentences = False # bool | Whether to generate full sentences only (optional) (default to False)
    chat_template = 'chat_template_example' # str | Override chat template for prompt formatting (optional)

    try:
        # Ollama Chat
        api_response = api_instance.ollama_chat(ollama_chat_request, ensure_full_sentences=ensure_full_sentences, chat_template=chat_template)
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_chat:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_chat: %s\n" % e)

Parameters

Name Type Description Notes
ollama_chat_request OllamaChatRequest
ensure_full_sentences bool Whether to generate full sentences only [optional] [default to False]
chat_template str Override chat template for prompt formatting [optional]

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_embed

object ollama_embed(ollama_embed_request)

Ollama Embed

Create embeddings, similar to Ollama's /api/embed endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.ollama_embed_request import OllamaEmbedRequest
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)
    ollama_embed_request = cms_client.OllamaEmbedRequest() # OllamaEmbedRequest | 

    try:
        # Ollama Embed
        api_response = api_instance.ollama_embed(ollama_embed_request)
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_embed:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_embed: %s\n" % e)

Parameters

Name Type Description Notes
ollama_embed_request OllamaEmbedRequest

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_generate

object ollama_generate(ollama_generate_request, ensure_full_sentences=ensure_full_sentences, chat_template=chat_template)

Ollama Generate

Generate a completion, similar to Ollama's /api/generate endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.ollama_generate_request import OllamaGenerateRequest
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)
    ollama_generate_request = cms_client.OllamaGenerateRequest() # OllamaGenerateRequest | 
    ensure_full_sentences = False # bool | Whether to generate full sentences only (optional) (default to False)
    chat_template = 'chat_template_example' # str | Override chat template for prompt formatting (optional)

    try:
        # Ollama Generate
        api_response = api_instance.ollama_generate(ollama_generate_request, ensure_full_sentences=ensure_full_sentences, chat_template=chat_template)
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_generate:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_generate: %s\n" % e)

Parameters

Name Type Description Notes
ollama_generate_request OllamaGenerateRequest
ensure_full_sentences bool Whether to generate full sentences only [optional] [default to False]
chat_template str Override chat template for prompt formatting [optional]

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_health_get

object ollama_health_get()

Ollama Health Get

Health check, similar to Ollama's / endpoint (GET)

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)

    try:
        # Ollama Health Get
        api_response = api_instance.ollama_health_get()
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_health_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_health_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_health_head

object ollama_health_head()

Ollama Health Head

Health check, similar to Ollama's / endpoint (HEAD)

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)

    try:
        # Ollama Health Head
        api_response = api_instance.ollama_health_head()
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_health_head:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_health_head: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_list_tags

object ollama_list_tags()

Ollama List Tags

List available models, similar to Ollama's /api/tags endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)

    try:
        # Ollama List Tags
        api_response = api_instance.ollama_list_tags()
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_list_tags:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_list_tags: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_show_model

object ollama_show_model(ollama_show_request)

Ollama Show Model

Show model information, similar to Ollama's /api/show endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.ollama_show_request import OllamaShowRequest
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)
    ollama_show_request = cms_client.OllamaShowRequest() # OllamaShowRequest | 

    try:
        # Ollama Show Model
        api_response = api_instance.ollama_show_model(ollama_show_request)
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_show_model:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_show_model: %s\n" % e)

Parameters

Name Type Description Notes
ollama_show_request OllamaShowRequest

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ollama_version

object ollama_version()

Ollama Version

Get the API version, similar to Ollama's /api/version endpoint

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.OperationsCompatibleWithOllamaAPIsApi(api_client)

    try:
        # Ollama Version
        api_response = api_instance.ollama_version()
        print("The response of OperationsCompatibleWithOllamaAPIsApi->ollama_version:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OperationsCompatibleWithOllamaAPIsApi->ollama_version: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]