GithubHelp home page GithubHelp logo

Comments (5)

maxdeichmann avatar maxdeichmann commented on June 21, 2024 1

@alexcannan and @Dev-Khant, thank you so much for looking into this. I agree, this is not very high on our Prio list and hence I will close it. Thanks for raising!

from langfuse-python.

Dev-Khant avatar Dev-Khant commented on June 21, 2024

@marcklingen @maxdeichmann Does this need to change?

from langfuse-python.

maxdeichmann avatar maxdeichmann commented on June 21, 2024

Hi @Dev-Khant and @alexcannan, sorry for being late here. This is something i wanted to take a look at, because it woudl definitely increase DX when using the Python library. Some background here:

  • We have a JS/TS and Python package and both of them talk to the same API on the backend
  • In the main repo, we have Fern definitions for our API, which then generates OpenAPI docs as well as Python code for that API
  • The TS SDK depends on the OpenAPI docs to generate TS code around the API.
  • The Python SDK has the /api folder which contains the Python code generated by Fern. All the pydantic code is generated by Fern.
  • Going forward, this is not the best approach, as we have API definitions in Zod, Fern, OpenAPI at the moment. We ended up with this setup as we did not want to change Python code every time we add a field to the API. At the same time, Python code generators from OpenAPI docs did not work well.

What are the ways forward?

  • Make changes to the Pydantic code, as you propose, but then we would not be able to re-generate Python code with fern as it would overwrite our changes.
  • Look into Fern and try to improve error handling. Unfortunately, we use the hosted version of Fern, i am not sure in how far you can use Fern as well. Creating the code would obv. be required to iterate on that
  • Completely remove the the Fern code and replace it with some other code wrappers.

@alexcannan and @Dev-Khant do you have opinions on that? I just asked Fern in how far the community can use Fern as well. Does anyone of you have experience with generating python code from OpanAPI docs?

from langfuse-python.

Dev-Khant avatar Dev-Khant commented on June 21, 2024

I don't have any experience for generating python code from OpenAPI docs. But I can look into it

from langfuse-python.

alexcannan avatar alexcannan commented on June 21, 2024

Hmm, I would suggest raising this to the fern developers. It's surprising that their python code generation has type: ignore flags, that's an orange flag for me. I can attempt to put together a very minimal SDK for my specific use case using the api directly. Actually, as long as I don't trigger any HTTP exceptions the SDK works as expected.

Thank you for the detailed explanation @maxdeichmann. It seems as long as no HTTP exceptions are raised, this is a non-issue for users. And, since the SDK is generated directly from API definitions, the chance of exceptions is relatively low. I'm happy to close this for now, since it seems to be a fern generation issue rather than a langfuse one, but I'll leave that up to y'all.

from langfuse-python.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.