traceloop / openllmetry

Open-source observability for your LLM application, based on OpenTelemetry
https://www.traceloop.com/openllmetry
Apache License 2.0
1.86k stars 154 forks source link

πŸš€ Feature: support structured outputs for OpenAI #1815

Open nirga opened 1 month ago

nirga commented 1 month ago

Which component is this feature for?

OpenAI Instrumentation

πŸ”– Feature description

Add support to OpenAI's recently announced structured outputs: https://openai.com/index/introducing-structured-outputs-in-the-api/ For example, support refusal responses

🎀 Why is this feature needed ?

-

✌️ How do you aim to achieve this?

-

πŸ”„οΈ Additional Information

No response

πŸ‘€ Have you spent some time to check if this feature request has been raised before?

Are you willing to submit PR?

None

Benedikt-Wolf commented 1 month ago

I'll have a look at it, if no one is working on this currently?

nirga commented 1 month ago

@Benedikt-Wolf thanks! no one is working on it currently

iarslankhalid commented 2 weeks ago

I'll have a look at it, if no one is working on this currently?

hey @Benedikt-Wolf, is there any update regarding this feature?

Benedikt-Wolf commented 2 weeks ago

Hey @iarslankhalid no, not at allπŸ˜…I am in a bit of a stress rn (last exam, job interviews, ...), so if u want to take over, please do so πŸ‘ I will probably not have time in the next 2 weeks

iarslankhalid commented 2 weeks ago

sure @Benedikt-Wolf .. Good luck with your exams and job interviews

vinit5112 commented 2 weeks ago

@nirga I will look at it, if no one is working on this currently?

nirga commented 2 weeks ago

Sure @vinit5112 :)

vinit5112 commented 2 weeks ago

@nirga, I understood the issue. But can you help me where we need to structure openai output.

nirga commented 5 days ago

Hey @vinit5112 sorry for thte delay I was OOO! We need to log the data returned by the structured output as OpenAI describes in this link: https://openai.com/index/introducing-structured-outputs-in-the-api/

For example, they return something like refusal which we don't log on the span currently

AnsariZayd commented 4 days ago

@nirga I will look at it, if no one is working on this currently?

nirga commented 4 days ago

Thanks @AnsariZayd! Not sure where @vinit5112 stands with this

AnsariZayd commented 4 days ago

Hi Nir, Thanks for giving me this opportunity. I am a little confused about what exactly the new feature is intended to do, it would be great if you can provide me some details related to the feature. Also I was looking at the code in the packages/opentelemetry-instrumentation-openai, I am not sure where do you want to add the new feature. Do you want to add a new folder or file for this feature and wanted to store the refusal in a new log ? Please let me know so that I can start working on it. regards, Zayd

On Wed, 18 Sept 2024 at 10:50, Nir Gazit @.***> wrote:

Thanks @AnsariZayd https://github.com/AnsariZayd! Not sure where @vinit5112 https://github.com/vinit5112 stands with this

β€” Reply to this email directly, view it on GitHub https://github.com/traceloop/openllmetry/issues/1815#issuecomment-2357520166, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXT7V34TMGYK2UY77DJ55RLZXEEQVAVCNFSM6AAAAABMC6IR5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGUZDAMJWGY . You are receiving this because you were mentioned.Message ID: @.***>

nirga commented 4 days ago

@AnsariZayd have you looked at this comment? https://github.com/traceloop/openllmetry/issues/1815#issuecomment-2353198528

AnsariZayd commented 4 days ago

OK I got it.

On Wed, 18 Sept 2024 at 12:10, Nir Gazit @.***> wrote:

@AnsariZayd https://github.com/AnsariZayd have you looked at this comment? #1815 (comment) https://github.com/traceloop/openllmetry/issues/1815#issuecomment-2353198528

β€” Reply to this email directly, view it on GitHub https://github.com/traceloop/openllmetry/issues/1815#issuecomment-2357628544, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXT7V37SX23OWVK3COAYEK3ZXEN63AVCNFSM6AAAAABMC6IR5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGYZDQNJUGQ . You are receiving this because you were mentioned.Message ID: @.***>