64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.09k stars 161 forks source link

Missing fields in `CreateTranscriptionResponse` #201

Closed emk closed 5 months ago

emk commented 5 months ago

Thank you for such a great library! I've been experimenting with this in an open source tool.

Normally, if I set timestamp_granularities=["segment", "word"] when creating a transcription, the API returns:

{
    "language": "spanish",
    "duration": 1409.5999755859375,
    "text": "...",
    "words": [
        {
            "word": "...",
            "start": 2.4800000190734863,
            "end": 3.1600000858306885
        }
    ],
    "segments": [
        {
            "id": 0,
            "seek": 0,
            "start": 2.4800000190734863,
            "end": 5.860000133514404,
            "text": "...",
            "tokens": [
                50414,
                ...
            ],
            "temperature": 0.20000000298023224,
            "avg_logprob": -0.28230372071266174,
            "compression_ratio": 1.465000033378601,
            "no_speech_prob": 0.22726023197174072
        }
    ]
}

But the current release only supports text, not the other fields.

I might be able to put together a PR when I get a minute. Thank you again for a great library!

64bit commented 5 months ago

Thank you for contributions! the changes for this is released in v0.20.0

emk commented 3 months ago

Fantastic! Thank you.