Skip to content

Commit 67e6c1b

Browse files
committed
Finalize 0.0.87
1 parent b93fbff commit 67e6c1b

File tree

8 files changed

+54
-8
lines changed

8 files changed

+54
-8
lines changed

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python3 -m pip install -r requirements.txt
2323
2424
- name: Pull Function C
25-
run: python3 fxnc.py --version 0.0.40
25+
run: python3 fxnc.py --version 0.0.41
2626

2727
- name: Build Muna
2828
run: python3 -m build

.github/workflows/testpypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python3 -m pip install -r requirements.txt
2020
2121
- name: Pull Function C
22-
run: python3 fxnc.py --version 0.0.40
22+
run: python3 fxnc.py --version 0.0.41
2323

2424
- name: Build Muna
2525
run: python3 -m build

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
+ Added support for `mp3` respose format in `muna.beta.openai.audio.speech.create` method.
33
+ Added `min` and `max` arguments in `Annotations.MaxOutputTokens` annotation method.
44
+ Replaced `Parameter.range` field to `Parameter.min` and `Parameter.max` fields.
5-
+ Upgraded to Function C 0.0.40.
5+
+ Upgraded to Function C 0.0.41.
66

77
## 0.0.86
88
+ Added `muna transpile --install-deps` flag to install dependencies before transpiling.

muna/beta/openai/completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def create(
9191
9292
Parameters:
9393
messages (list): Messages for the conversation so far.
94-
model (str): Chat model predictor tag.
94+
model (str): Chat model tag.
9595
stream (bool): Whether to stream responses.
9696
response_format (dict): Response format.
9797
reasoning_effort (ChatCompletionReasoningEffort): Reasoning effort for reasoning models.

muna/beta/openai/embeddings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def create(
4747
4848
Parameters:
4949
input (str | list): Input text to embed. The input must not exceed the max input tokens for the model.
50-
model (str): Embedding model predictor tag.
50+
model (str): Embedding model tag.
5151
dimensions (int): The number of dimensions the resulting output embeddings should have. Only supported by Matryoshka embedding models.
5252
encoding_format (str): The format to return the embeddings in.
5353
acceleration (Acceleration | RemoteAcceleration): Prediction acceleration.

muna/beta/openai/schema.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ class SpeechCreateResponse(BaseModel, **ConfigDict(arbitrary_types_allowed=True)
6868
content: bytes
6969
response: Response
7070

71+
class Transcription(BaseModel):
72+
class TokenUsage(BaseModel):
73+
class InputTokenDetails(BaseModel):
74+
audio_tokens: int
75+
text_tokens: int
76+
type: Literal["tokens"]
77+
input_tokens: int
78+
output_tokens: int
79+
total_tokens: int
80+
input_token_details: InputTokenDetails
81+
class DurationUsage(BaseModel):
82+
type: Literal["duration"]
83+
seconds: float
84+
text: str
85+
usage: TokenUsage | DurationUsage
86+
7187
class _MessageDict(TypedDict): # For text completion
7288
role: Literal["assistant", "user", "system"]
7389
content: str | None

muna/beta/openai/speech.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def create(
5050
5151
Parameters:
5252
input (str): The text to generate audio for.
53-
model (str): Speech generation predictor tag.
53+
model (str): Speech generation model tag.
5454
voice (str): Voice to use when generating the audio.
5555
response_format ("mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"): Audio output format.
5656
speed (float): The speed of the generated audio. Defaults to 1.0.

muna/beta/openai/transcription.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#
55

66
from collections.abc import Callable
7+
from typing import BinaryIO
78

89
from ...services import PredictorService, PredictionService
9-
from ...types import Acceleration, Dtype
10+
from ...types import Acceleration
1011
from ..remote import RemoteAcceleration
1112
from ..remote.remote import RemotePredictionService
13+
from .schema import Transcription
1214

1315
TranscriptionDelegate = Callable[..., object]
1416

@@ -26,4 +28,32 @@ def __init__(
2628
self.__predictors = predictors
2729
self.__predictions = predictions
2830
self.__remote_predictions = remote_predictions
29-
self.__cache = dict[str, TranscriptionDelegate]()
31+
self.__cache = dict[str, TranscriptionDelegate]()
32+
33+
def create(
34+
self,
35+
*,
36+
file: BinaryIO,
37+
model: str,
38+
language: str | None=None,
39+
prompt: str | None=None,
40+
stream: bool=False,
41+
temperature: float=0.,
42+
acceleration: Acceleration | RemoteAcceleration="remote_auto"
43+
) -> Transcription:
44+
"""
45+
Transcribe audio into the input language.
46+
47+
Parameters:
48+
file (BinaryIO): Audio file to transcribe. MUST be flac, mp3, ogg, wav.
49+
model (str): Transcription model tag.
50+
language (str): The language of the input audio.
51+
prompt (str): Text to guide the model's style or continue a previous audio segment.
52+
stream (bool): Whether to stream transcription events.
53+
temperature (float): The sampling temperature, between 0 and 1.
54+
acceleration (Acceleration | RemoteAcceleration): Prediction acceleration.
55+
56+
Returns:
57+
Transcription: Result transcription.
58+
"""
59+
pass

0 commit comments

Comments
 (0)