File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,31 @@ as well.
2929
3030## Usage
3131
32+ Instantiate the Langfuse Client with the respective endpoint and your API Keys.
3233
34+ ``` java
35+ import com.langfuse.client.LangfuseClient ;
36+
37+ LangfuseClient client = LangfuseClient . builder()
38+ .url(" https://cloud.langfuse.com" ) // 🇪🇺 EU data region
39+ // .url("https://us.cloud.langfuse.com") // 🇺🇸 US data region
40+ // .url("http://localhost:3000") // 🏠 Local deployment
41+ .credentials(" pk-lf-..." , " sk-lf-..." )
42+ .build();
43+ ```
44+
45+ Make requests using the clients:
46+
47+ ``` java
48+ import com.langfuse.client.core.LangfuseClientApiException ;
49+
50+ try {
51+ PromptMetaListResponse prompts = client. prompts(). list();
52+ } catch (LangfuseClientApiException error) {
53+ System . out. println(error. getBody());
54+ System . out. println(error. getStatusCode());
55+ }
56+ ```
3357
3458## Updating
3559
You can’t perform that action at this time.
0 commit comments