Client

.. py:module:: pyjev.client

Thin Python convenience API over TypeSafe’s official SDK.

.. py:class:: Jev(*, api_key=None, model=None, timeout=None, client=None) :module: pyjev.client

Bases: :py:class:object

Convenience client for common Jev decisions.

Jev deliberately delegates transport, retries, validation, and API semantics to typesafe-sdk. It only adds ergonomic request construction and result wrappers.

.. py:method:: Jev.init(*, api_key=None, model=None, timeout=None, client=None) :module: pyjev.client

  Create a client or wrap a caller-owned SDK client.

  An injected client cannot be combined with `api_key`, `model`, or `timeout`,
  and is never closed by :meth:`close`.

.. py:property:: Jev.client :module: pyjev.client :type: ~typesafe_sdk._core.client.sync.client.TypeSafeClient

  Return the underlying SDK client.

.. py:method:: Jev.ask(question, *, state, true=None, false=None, model=None) :module: pyjev.client

  Alias for :meth:`noul`.

.. py:method:: Jev.noul(question, *, state, true=None, false=None, model=None) :module: pyjev.client

  Evaluate a yes/no question and preserve the probability of true.

.. py:method:: Jev.choice(question, *, state, choices, model=None) :module: pyjev.client

  Evaluate a closed-set Choice question.

.. py:method:: Jev.score(question, *, state, levels, model=None) :module: pyjev.client

  Evaluate state against an ordered Score rubric.

.. py:method:: Jev.decide(name, *, state, config=None, model=None) :module: pyjev.client

  Evaluate a named primitive or bundle decision from TOML.

.. py:method:: Jev.run(*, state, questions, model=None) :module: pyjev.client

  Evaluate several independent SDK questions in one request.

.. py:method:: Jev.models() :module: pyjev.client

  List models using the underlying SDK client.

.. py:method:: Jev.close() :module: pyjev.client

  Close only a client created by this instance.

.. py:class:: AsyncJev(*, api_key=None, model=None, timeout=None, client=None) :module: pyjev.client

Bases: :py:class:object

Native async counterpart to :class:Jev using the SDK async client.

.. py:method:: AsyncJev.init(*, api_key=None, model=None, timeout=None, client=None) :module: pyjev.client

  Create an async client without simulating async over synchronous I/O.

.. py:property:: AsyncJev.client :module: pyjev.client :type: ~typesafe_sdk._core.client.aio.client.AsyncTypeSafeClient

  Return the underlying native async SDK client.

.. py:method:: AsyncJev.ask(question, *, state, true=None, false=None, model=None) :module: pyjev.client :async:

  Async alias for :meth:`noul`.

.. py:method:: AsyncJev.noul(question, *, state, true=None, false=None, model=None) :module: pyjev.client :async:

  Evaluate Noul through the native async SDK client.

.. py:method:: AsyncJev.choice(question, *, state, choices, model=None) :module: pyjev.client :async:

  Evaluate Choice through the native async SDK client.

.. py:method:: AsyncJev.score(question, *, state, levels, model=None) :module: pyjev.client :async:

  Evaluate Score through the native async SDK client.

.. py:method:: AsyncJev.decide(name, *, state, config=None, model=None) :module: pyjev.client :async:

  Evaluate a named primitive or bundle asynchronously.

.. py:method:: AsyncJev.run(*, state, questions, model=None) :module: pyjev.client :async:

  Evaluate several SDK questions asynchronously in one request.

.. py:method:: AsyncJev.models() :module: pyjev.client :async:

  List models through the native async SDK client.

.. py:method:: AsyncJev.close() :module: pyjev.client :async:

  Close only a client created by this instance.