Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix traceable and wrapOpenAI #640

Merged
merged 10 commits into from
Apr 30, 2024
Merged

Fix traceable and wrapOpenAI #640

merged 10 commits into from
Apr 30, 2024

Commits on Apr 29, 2024

  1. Upgrade typescript to 5.4.5

    - Switch out implementation for generating parallel CJS build
    - Follow guidelines from here microsoft/TypeScript#54567
    nfcampos committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    3238a4b View commit details
    Browse the repository at this point in the history
  2. One more

    nfcampos committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    18c05ac View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Lint

    nfcampos committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    74e173d View commit details
    Browse the repository at this point in the history
  2. Add failing tests for traceable

    - errors throw from sync and async functions should result in errored run
    - errors thrown by promise of async generator should result in errored run containing all output until then
    - interrupted promise of async generator should result in cancelled (errored) run containing all output until then
    - regular async generator (without promise wrapper) should be supported in success, error and interrupt cases
    nfcampos committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    aec89af View commit details
    Browse the repository at this point in the history
  3. Implement correct error and cancellation handling in traceable, ensur…

    …e traceable doesn't modify return value of wrapped function
    
    - if function returns a subclass of promise return proxy object combining original return value and "traced" promise
    - if function returns async generator (without promise wrapper) do not wrap it in a promise
    - handle errors thrown in generator functions
    - handle errors thrown in sync functions
    - handle generator cancellations
    - handle errors thrown by tracing client
    nfcampos committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    482b053 View commit details
    Browse the repository at this point in the history
  4. Add failing tests for openai sdk wrapper

    - Use custom return value methods on openai[.chat].completions.create()
    - Test that call-time metadata is attached to run
    nfcampos committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    9c388b8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a14639c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    33637c5 View commit details
    Browse the repository at this point in the history
  7. Re-implement openai sdk using traceable decorator directly

    - also fix return type of patched openai sdk (it was missing lots of methods on the original)
    nfcampos committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    cd0ecaa View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0de86a9 View commit details
    Browse the repository at this point in the history