client
A package for defining instructor clients.
ModelClass
get_anthropic_aclient(mode=instructor.Mode.ANTHROPIC_JSON, base_url=None, api_key=None, enable_prompt_caching=False)
cached
Get the async Anthropic client.
Ensure that ANTHROPIC_API_KEY
is set.
Source code in spark_instructor/client/base.py
get_anthropic_client(mode=instructor.Mode.ANTHROPIC_JSON, base_url=None, api_key=None, enable_prompt_caching=False)
cached
Get the Anthropic client.
Ensure that ANTHROPIC_API_KEY
is set.
Source code in spark_instructor/client/base.py
get_async_instructor(model_class=None, mode=None, api_key=None, base_url=None)
Get the instructor client based on the model class and mode.
Source code in spark_instructor/client/base.py
get_databricks_aclient(mode=instructor.Mode.MD_JSON, base_url=None, api_key=None)
cached
Get the async databricks client.
Unless passed as arguments,
ensure that the DATABRICKS_HOST
and DATABRICKS_TOKEN
environment variables are set.
Source code in spark_instructor/client/base.py
get_databricks_client(mode=instructor.Mode.MD_JSON, base_url=None, api_key=None)
cached
Get the databricks client.
Unless passed as arguments,
ensure that the DATABRICKS_HOST
and DATABRICKS_TOKEN
environment variables are set.
Source code in spark_instructor/client/base.py
get_instructor(model_class=None, mode=None, api_key=None, base_url=None)
Get the instructor client based on the model class and mode.
Source code in spark_instructor/client/base.py
get_ollama_aclient(mode=instructor.Mode.JSON, base_url=None, api_key=None)
cached
Get the async Ollama client.
Source code in spark_instructor/client/base.py
get_ollama_client(mode=instructor.Mode.JSON, base_url=None, api_key=None)
cached
Get the Ollama client.
Source code in spark_instructor/client/base.py
get_openai_aclient(mode=instructor.Mode.TOOLS, base_url=None, api_key=None)
cached
Get the async OpenAI client.
Unless passes as an argument,
Ensure that OPENAI_API_KEY
is set.
Source code in spark_instructor/client/base.py
get_openai_client(mode=instructor.Mode.TOOLS, base_url=None, api_key=None)
cached
Get the OpenAI client.
Unless passes as an argument,
Ensure that OPENAI_API_KEY
is set.
Source code in spark_instructor/client/base.py
infer_model_class(model_name)
Attempt to infer the model class from the model name.