Guardrail Completions Resource#

Sync Guardrail Completions Resource#

class nemo_microservices.resources.guardrail.CompletionsResource(client: NeMoMicroservices)

Bases: SyncAPIResource

property with_raw_response: CompletionsResourceWithRawResponse

This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#accessing-raw-response-data-e-g-headers

property with_streaming_response: CompletionsResourceWithStreamingResponse

An alternative to .with_raw_response that doesn’t eagerly read the response body.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#with_streaming_response

create(
*,
model: str,
best_of: int | NotGiven = NOT_GIVEN,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: str | object | NotGiven = NOT_GIVEN,
guardrails: GuardrailsDataParam | NotGiven = NOT_GIVEN,
ignore_eos: bool | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: bool | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
n: int | NotGiven = NOT_GIVEN,
presence_penalty: float | NotGiven = NOT_GIVEN,
prompt: Iterable[int] | Iterable[Iterable[int]] | str | List[str] | NotGiven = NOT_GIVEN,
response_format: Dict[str, str] | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
stop: List[str] | str | NotGiven = NOT_GIVEN,
stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
suffix: str | NotGiven = NOT_GIVEN,
system_fingerprint: str | NotGiven = NOT_GIVEN,
temperature: float | NotGiven = NOT_GIVEN,
tool_choice: str | object | NotGiven = NOT_GIVEN,
tools: List[str] | NotGiven = NOT_GIVEN,
top_logprobs: int | NotGiven = NOT_GIVEN,
top_p: float | NotGiven = NOT_GIVEN,
user: str | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) GuardrailCompletionResponse | Stream[GuardrailCompletionStreamResponse]
create_from_dict(
data: dict[str, object],
) object

Async Guardrail Completions Resource#

class nemo_microservices.resources.guardrail.AsyncCompletionsResource(client: AsyncNeMoMicroservices)

Bases: AsyncAPIResource

property with_raw_response: AsyncCompletionsResourceWithRawResponse

This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#accessing-raw-response-data-e-g-headers

property with_streaming_response: AsyncCompletionsResourceWithStreamingResponse

An alternative to .with_raw_response that doesn’t eagerly read the response body.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#with_streaming_response

create(
*,
model: str,
best_of: int | NotGiven = NOT_GIVEN,
echo: bool | NotGiven = NOT_GIVEN,
frequency_penalty: float | NotGiven = NOT_GIVEN,
function_call: str | object | NotGiven = NOT_GIVEN,
guardrails: GuardrailsDataParam | NotGiven = NOT_GIVEN,
ignore_eos: bool | NotGiven = NOT_GIVEN,
logit_bias: Dict[str, float] | NotGiven = NOT_GIVEN,
logprobs: bool | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
n: int | NotGiven = NOT_GIVEN,
presence_penalty: float | NotGiven = NOT_GIVEN,
prompt: Iterable[int] | Iterable[Iterable[int]] | str | List[str] | NotGiven = NOT_GIVEN,
response_format: Dict[str, str] | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
stop: List[str] | str | NotGiven = NOT_GIVEN,
stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
suffix: str | NotGiven = NOT_GIVEN,
system_fingerprint: str | NotGiven = NOT_GIVEN,
temperature: float | NotGiven = NOT_GIVEN,
tool_choice: str | object | NotGiven = NOT_GIVEN,
tools: List[str] | NotGiven = NOT_GIVEN,
top_logprobs: int | NotGiven = NOT_GIVEN,
top_p: float | NotGiven = NOT_GIVEN,
user: str | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) GuardrailCompletionResponse | AsyncStream[GuardrailCompletionStreamResponse]
create_from_dict(
data: dict[str, object],
) object