belso.translator.providers package
Submodules
belso.translator.providers.anthropic module
- belso.translator.providers.anthropic.from_anthropic(schema)[source]
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)[source]
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.huggingface module
belso.translator.providers.langchain module
belso.translator.providers.mistral module
belso.translator.providers.ollama module
belso.translator.providers.openai module
Module contents
- belso.translator.providers.from_anthropic(schema)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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.