Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 4, 2024
1 parent f812fc4 commit 3c3ae55
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-e5ad2fb12fbda084403c1696af9dbe7eeb5f0025134473dea7632339d4d7d00b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-387e688cfbf5098041d47c9c918c15d4978f98768b4daf901267aea8affc0a30.yml
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ client = Writer(
chat = client.chat.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down Expand Up @@ -68,7 +68,7 @@ async def main() -> None:
chat = await client.chat.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down Expand Up @@ -144,7 +144,7 @@ try:
client.chat.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down Expand Up @@ -195,7 +195,7 @@ client = Writer(
client.with_options(max_retries=5).chat.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down Expand Up @@ -226,7 +226,7 @@ client = Writer(
client.with_options(timeout=5.0).chat.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down Expand Up @@ -272,7 +272,7 @@ from writerai import Writer
client = Writer()
response = client.chat.with_raw_response.chat(
messages=[{
"content": "Hello!",
"content": "string",
"role": "user",
}],
model="palmyra-x-32k",
Expand All @@ -297,7 +297,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
with client.chat.with_streaming_response.chat(
messages=[
{
"content": "Hello!",
"content": "string",
"role": "user",
}
],
Expand Down
198 changes: 192 additions & 6 deletions src/writerai/resources/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,40 @@ def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Chat:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -94,9 +125,40 @@ def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Stream[ChatStreamingData]:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -127,9 +189,40 @@ def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Chat | Stream[ChatStreamingData]:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -212,9 +305,40 @@ async def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Chat:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -245,9 +369,40 @@ async def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncStream[ChatStreamingData]:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -278,9 +433,40 @@ async def chat(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Chat | AsyncStream[ChatStreamingData]:
"""
Create chat completion
Chat completion
Args:
messages: An array of message objects that form the conversation history or context for
the model to respond to. The array must contain at least one message.
model: Specifies the model to be used for generating responses. The chat model is
always `palmyra-x-002-32k` for conversational use.
stream: Indicates whether the response should be streamed incrementally as it is
generated or only returned once fully complete. Streaming can be useful for
providing real-time feedback in interactive applications.
max_tokens: Defines the maximum number of tokens (words and characters) that the model can
generate in the response. The default value is set to 16, but it can be adjusted
to allow for longer or shorter responses as needed.
n: Specifies the number of completions (responses) to generate from the model in a
single request. This parameter allows multiple responses to be generated,
offering a variety of potential replies from which to choose.
stop: A token or sequence of tokens that, when generated, will cause the model to stop
producing further content. This can be a single token or an array of tokens,
acting as a signal to end the output.
temperature: Controls the randomness or creativity of the model's responses. A higher
temperature results in more varied and less predictable text, while a lower
temperature produces more deterministic and conservative outputs.
top_p: Sets the threshold for "nucleus sampling," a technique to focus the model's
token generation on the most likely subset of tokens. Only tokens with
cumulative probability above this threshold are considered, controlling the
trade-off between creativity and coherence.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand Down
Loading

0 comments on commit 3c3ae55

Please sign in to comment.