Skip to content

Commit

Permalink
fix(sdk): best_of in completions was an int and should be a string (#…
Browse files Browse the repository at this point in the history
…1031)

* changing best_of to a string in completions

* Revert "changing best_of to a string in completions"

This reverts commit 1166dd8.

Needed to ensure pre-commit was on firstly

* update completion proto and ran make gen-python

* update ruff configurations

* drop unsupported property

* fix formatting
  • Loading branch information
lemonprogis authored Sep 16, 2024
1 parent 4fe42fb commit 4e5c1b6
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 4 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ generate-hashes = true
[tool.ruff]
target-version = "py311"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"

[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]

Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/audio/audio_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/leapfrogai_sdk/audio/audio_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AudioMetadata(_message.Message):
SRT: _ClassVar[AudioMetadata.AudioFormat]
VERBOSE_JSON: _ClassVar[AudioMetadata.AudioFormat]
VTT: _ClassVar[AudioMetadata.AudioFormat]

JSON: AudioMetadata.AudioFormat
TEXT: AudioMetadata.AudioFormat
SRT: AudioMetadata.AudioFormat
Expand Down Expand Up @@ -114,6 +115,7 @@ class AudioResponse(_message.Message):
no_speech_prob: _Optional[float] = ...,
transient: bool = ...,
) -> None: ...

TASK_FIELD_NUMBER: _ClassVar[int]
LANGUAGE_FIELD_NUMBER: _ClassVar[int]
DURATION_FIELD_NUMBER: _ClassVar[int]
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/audio/audio_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""

import grpc

from leapfrogai_sdk.audio import audio_pb2 as leapfrogai__sdk_dot_audio_dot_audio__pb2
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/chat/chat_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/leapfrogai_sdk/chat/chat_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class ChatCompletionRequest(_message.Message):
def __init__(
self, key: _Optional[str] = ..., value: _Optional[int] = ...
) -> None: ...

CHAT_ITEMS_FIELD_NUMBER: _ClassVar[int]
MAX_NEW_TOKENS_FIELD_NUMBER: _ClassVar[int]
TEMPERATURE_FIELD_NUMBER: _ClassVar[int]
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/chat/chat_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""

import grpc

from leapfrogai_sdk.chat import chat_pb2 as leapfrogai__sdk_dot_chat_dot_chat__pb2
Expand Down
3 changes: 2 additions & 1 deletion src/leapfrogai_sdk/completion/completion_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/leapfrogai_sdk/completion/completion_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class CompletionRequest(_message.Message):
def __init__(
self, key: _Optional[str] = ..., value: _Optional[int] = ...
) -> None: ...

PROMPT_FIELD_NUMBER: _ClassVar[int]
SUFFIX_FIELD_NUMBER: _ClassVar[int]
MAX_NEW_TOKENS_FIELD_NUMBER: _ClassVar[int]
Expand Down Expand Up @@ -90,7 +91,7 @@ class CompletionRequest(_message.Message):
repetition_penalty: float
presence_penalty: float
frequence_penalty: float
best_of: int
best_of: str
logit_bias: _containers.ScalarMap[str, int]
return_full_text: bool
truncate: int
Expand All @@ -114,7 +115,7 @@ class CompletionRequest(_message.Message):
repetition_penalty: _Optional[float] = ...,
presence_penalty: _Optional[float] = ...,
frequence_penalty: _Optional[float] = ...,
best_of: _Optional[int] = ...,
best_of: _Optional[str] = ...,
logit_bias: _Optional[_Mapping[str, int]] = ...,
return_full_text: bool = ...,
truncate: _Optional[int] = ...,
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/completion/completion_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""

import grpc

from leapfrogai_sdk.completion import (
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/embeddings/embeddings_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/leapfrogai_sdk/embeddings/embeddings_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""

import grpc

from leapfrogai_sdk.embeddings import (
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/name/name_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/leapfrogai_sdk/name/name_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""

import grpc

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ message CompletionRequest {
optional float repetition_penalty = 12;
optional float presence_penalty = 13;
optional float frequence_penalty = 14;
optional int32 best_of = 15;
optional string best_of = 15;
map<string, int32> logit_bias = 16; // Maps are represented as a pair of a key type and a value type.
optional bool return_full_text = 17;
optional int32 truncate = 18;
Expand Down

0 comments on commit 4e5c1b6

Please sign in to comment.