more example for normal springboot project.
Hi Steffen, If don't use spring AI or langchain4j. Can langfuse monitor normal Springboot project. like I use simple api call to LLM. how the langfuse monitor this model. Do your have more example ? many thanks
@Namelesschz I think we can provide additional examples or more guidance for spring, yes. It's hard to create representative cases from scratch though. Do you have an existing code snippet that you could share and that we can then instrument? That would help us ensure that our examples are relevant for users like you.
@Steffen911 sure.
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.builder()
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
.build();
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
.addUserMessage("who are your")
.model("qwen-plus")
.build();
ChatCompletion chatCompletion = client.chat().completions().create(params);
System.out.println(chatCompletion.choices().get(0).message().content().orElse("not response"));
}
This is simple example to call the LLM. we use websoceket to build the assistants application.
I would also like to see some examples on how to use the prompt management feature with basic examples such as in this overview
@cceyda Did you try to integrate with prompt management on your own? It should be quite straightforward given the APIs. I don't think we could add those examples soon, but if you give it a shot and contribute an overview on what you did, I'ld love to get them merged here.
I also need more examples about how to use java api .
@fenggangchen-alt Can you share specific questions? What kind of calls do you want to make?