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

Add TestContainers for running the Mock server #54

Open
jdubois opened this issue Dec 18, 2024 · 5 comments
Open

Add TestContainers for running the Mock server #54

jdubois opened this issue Dec 18, 2024 · 5 comments

Comments

@jdubois
Copy link

jdubois commented Dec 18, 2024

As a Java developer, I don't want to run those NPM scripts on my machine, could we have TestContainers support to automate running the Mock server inside a container?

It would be something like:

val prism =
            GenericContainer("stoplight/prism:5.12.1")
                .withCommand(
                    "mock https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml"
                )
                .withExposedPorts(4010)

        prism.start()
@TomerAberbach
Copy link
Collaborator

Interesting idea!

I'm curious, are you using the mock Prism server to write tests for your usage of the SDK?

@jdubois
Copy link
Author

jdubois commented Dec 18, 2024

I wanted to have a look at your SDK and maybe contribute (I work at Microsoft, and I also contribute to @langchain4j ), so first thing I’m doing is building the project and running the tests.

The goal here is to make it easier to contribute.
Here’s a similar integration test from LangChain4j, with TestContainers, to give you an example:
https://github.com/langchain4j/langchain4j/blob/main/document-loaders/langchain4j-document-loader-azure-storage-blob/src/test/java/dev/langchain4j/data/document/loader/azure/storage/blob/LocalAzureBlobStorageDocumentLoaderIT.java

@TomerAberbach
Copy link
Collaborator

Cool, I'll take a look at that!

Just to set expectations, this SDK is generated by the Stainless code generator (I work there), and we're actively making changes to the generator. You'll see reflected in releases of the SDK.

So if you want to work on something or have ideas, then I would recommend running the idea buy us before starting, just to make sure you don't waste your time and that whatever custom/manual work you do could conceivably be integrated back into the code generation.

@jdubois
Copy link
Author

jdubois commented Dec 19, 2024

Ah ah I totally know who you are and what you do at Stainless, I work with the Java SDK team at Microsoft :-)
Also I built @jhipster and I understand how you work with the generator, which is why I posted this ticket and not a PR.

To be transparent: my plan is to add OpenAI Java SDK support to LangChain4j in the next weeks, so as soon as I see anything to update or modify, I'll open up tickets here.

@TomerAberbach
Copy link
Collaborator

Ah ah I totally know who you are and what you do at Stainless, I work with the Java SDK team at Microsoft :-) Also I built @jhipster and I understand how you work with the generator, which is why I posted this ticket and not a PR.

Nice :)

To be transparent: my plan is to add OpenAI Java SDK support to LangChain4j in the next weeks, so as soon as I see anything to update or modify, I'll open up tickets here.

Sounds great! In case you didn't know/see, just a heads up that this SDK is in alpha so there will likely be some breaking changes, in case that affects your integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants