belso.translator.providers package — belso 0.0.1 documentation

# belso.translator.providers package

## Submodules

## belso.translator.providers.anthropic module

belso.translator.providers.anthropic.from_anthropic(schema)

  Convert an Anthropic schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  param schema:

    the Anthropic schema to convert.

  type schema:

    Dict[str, Any]

  ### Returns

  - Type[Schema]: a standard schema subclass

belso.translator.providers.anthropic.to_anthropic(schema)

  Translate a standard schema to Anthropic Claude format. Anthropic Claude uses a JSON schema format similar to OpenAPI.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  ### Returns

  - Dict[str, Any]: the converted schema.

## belso.translator.providers.google module

belso.translator.providers.google.from_google(schema)

  Convert a Google Gemini schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema (content.Schema) : the Google Gemini schema to convert.

  ### Returns

  - Type[Schema]: a standard schema.

belso.translator.providers.google.to_google(schema)

  Translate a standard schema to Google Gemini format.

  Return type:

    `Schema`

  ### Args

  - schema (Type[Schema]) : the belso schema to translate.

  ### Returns

  - content.Schema: a Google Gemini schema in dict format for use in the API.

## belso.translator.providers.huggingface module

belso.translator.providers.huggingface.from_huggingface(schema)

  Convert a Hugging Face schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.huggingface.to_huggingface(schema)

  Translate a standard schema to Hugging Face format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary.

## belso.translator.providers.langchain module

belso.translator.providers.langchain.from_langchain(schema)

  Convert a LangChain schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.langchain.to_langchain(schema)

  Translate a standard schema to LangChain format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary for LangChain.

## belso.translator.providers.mistral module

belso.translator.providers.mistral.from_mistral(schema)

  Convert a Mistral AI schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.mistral.to_mistral(schema)

  Translate a standard schema to Mistral AI format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary.

## belso.translator.providers.ollama module

belso.translator.providers.ollama.from_ollama(schema)

  Convert an Ollama schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Dict[str, Any]

  ### Returns:

  - Type[Schema]: the converted schema as a belso Schema subclass.

belso.translator.providers.ollama.to_ollama(schema)

  Translate a standard schema to Ollama format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to translate.

  type schema:

    Type[Schema]

  ### Returns:

  - Dict[str, Any]: the translated schema in Ollama format.

## belso.translator.providers.openai module

belso.translator.providers.openai.from_openai(schema)

  Convert an OpenAI schema (Pydantic model) to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a standard Schema subclass.

belso.translator.providers.openai.to_openai(schema)

  Translate a standard schema to OpenAI GPT format (Pydantic model).

  Return type:

    `Type`

  ### Args

  - schema: the schema to translate.

  ### Returns

  - Type: the translated schema as a Pydantic model.

## Module contents

belso.translator.providers.from_anthropic(schema)

  Convert an Anthropic schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  param schema:

    the Anthropic schema to convert.

  type schema:

    Dict[str, Any]

  ### Returns

  - Type[Schema]: a standard schema subclass

belso.translator.providers.from_google(schema)

  Convert a Google Gemini schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema (content.Schema) : the Google Gemini schema to convert.

  ### Returns

  - Type[Schema]: a standard schema.

belso.translator.providers.from_huggingface(schema)

  Convert a Hugging Face schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.from_langchain(schema)

  Convert a LangChain schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.from_mistral(schema)

  Convert a Mistral AI schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a belso Schema subclass.

belso.translator.providers.from_ollama(schema)

  Convert an Ollama schema to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Dict[str, Any]

  ### Returns:

  - Type[Schema]: the converted schema as a belso Schema subclass.

belso.translator.providers.from_openai(schema)

  Convert an OpenAI schema (Pydantic model) to belso Schema format.

  Return type:

    `Type`[`Schema`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Type: the converted schema as a standard Schema subclass.

belso.translator.providers.to_anthropic(schema)

  Translate a standard schema to Anthropic Claude format. Anthropic Claude uses a JSON schema format similar to OpenAPI.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  ### Returns

  - Dict[str, Any]: the converted schema.

belso.translator.providers.to_google(schema)

  Translate a standard schema to Google Gemini format.

  Return type:

    `Schema`

  ### Args

  - schema (Type[Schema]) : the belso schema to translate.

  ### Returns

  - content.Schema: a Google Gemini schema in dict format for use in the API.

belso.translator.providers.to_huggingface(schema)

  Translate a standard schema to Hugging Face format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary.

belso.translator.providers.to_langchain(schema)

  Translate a standard schema to LangChain format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary for LangChain.

belso.translator.providers.to_mistral(schema)

  Translate a standard schema to Mistral AI format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  - schema: the schema to convert.

  ### Returns

  - Dict[str, Any]: the converted schema as a dictionary.

belso.translator.providers.to_ollama(schema)

  Translate a standard schema to Ollama format.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to translate.

  type schema:

    Type[Schema]

  ### Returns:

  - Dict[str, Any]: the translated schema in Ollama format.

belso.translator.providers.to_openai(schema)

  Translate a standard schema to OpenAI GPT format (Pydantic model).

  Return type:

    `Type`

  ### Args

  - schema: the schema to translate.

  ### Returns

  - Type: the translated schema as a Pydantic model.