|
| 1 | +/** |
| 2 | + * This file was auto-generated by Fern from our API Definition. |
| 3 | + */ |
| 4 | + |
| 5 | +package com.langfuse.client; |
| 6 | + |
| 7 | +import com.langfuse.client.core.ClientOptions; |
| 8 | +import com.langfuse.client.core.Suppliers; |
| 9 | +import java.util.function.Supplier; |
| 10 | +import com.langfuse.client.resources.comments.CommentsClient; |
| 11 | +import com.langfuse.client.resources.datasetitems.DatasetItemsClient; |
| 12 | +import com.langfuse.client.resources.datasetrunitems.DatasetRunItemsClient; |
| 13 | +import com.langfuse.client.resources.datasets.DatasetsClient; |
| 14 | +import com.langfuse.client.resources.health.HealthClient; |
| 15 | +import com.langfuse.client.resources.ingestion.IngestionClient; |
| 16 | +import com.langfuse.client.resources.media.MediaClient; |
| 17 | +import com.langfuse.client.resources.metrics.MetricsClient; |
| 18 | +import com.langfuse.client.resources.models.ModelsClient; |
| 19 | +import com.langfuse.client.resources.observations.ObservationsClient; |
| 20 | +import com.langfuse.client.resources.projects.ProjectsClient; |
| 21 | +import com.langfuse.client.resources.prompts.PromptsClient; |
| 22 | +import com.langfuse.client.resources.promptversion.PromptVersionClient; |
| 23 | +import com.langfuse.client.resources.score.ScoreClient; |
| 24 | +import com.langfuse.client.resources.scoreconfigs.ScoreConfigsClient; |
| 25 | +import com.langfuse.client.resources.sessions.SessionsClient; |
| 26 | +import com.langfuse.client.resources.trace.TraceClient; |
| 27 | + |
| 28 | +public class LangfuseClient { |
| 29 | + protected final ClientOptions clientOptions; |
| 30 | + |
| 31 | + protected final Supplier<CommentsClient> commentsClient; |
| 32 | + |
| 33 | + protected final Supplier<DatasetItemsClient> datasetItemsClient; |
| 34 | + |
| 35 | + protected final Supplier<DatasetRunItemsClient> datasetRunItemsClient; |
| 36 | + |
| 37 | + protected final Supplier<DatasetsClient> datasetsClient; |
| 38 | + |
| 39 | + protected final Supplier<HealthClient> healthClient; |
| 40 | + |
| 41 | + protected final Supplier<IngestionClient> ingestionClient; |
| 42 | + |
| 43 | + protected final Supplier<MediaClient> mediaClient; |
| 44 | + |
| 45 | + protected final Supplier<MetricsClient> metricsClient; |
| 46 | + |
| 47 | + protected final Supplier<ModelsClient> modelsClient; |
| 48 | + |
| 49 | + protected final Supplier<ObservationsClient> observationsClient; |
| 50 | + |
| 51 | + protected final Supplier<ProjectsClient> projectsClient; |
| 52 | + |
| 53 | + protected final Supplier<PromptVersionClient> promptVersionClient; |
| 54 | + |
| 55 | + protected final Supplier<PromptsClient> promptsClient; |
| 56 | + |
| 57 | + protected final Supplier<ScoreConfigsClient> scoreConfigsClient; |
| 58 | + |
| 59 | + protected final Supplier<ScoreClient> scoreClient; |
| 60 | + |
| 61 | + protected final Supplier<SessionsClient> sessionsClient; |
| 62 | + |
| 63 | + protected final Supplier<TraceClient> traceClient; |
| 64 | + |
| 65 | + public LangfuseClient(ClientOptions clientOptions) { |
| 66 | + this.clientOptions = clientOptions; |
| 67 | + this.commentsClient = Suppliers.memoize(() -> new CommentsClient(clientOptions)); |
| 68 | + this.datasetItemsClient = Suppliers.memoize(() -> new DatasetItemsClient(clientOptions)); |
| 69 | + this.datasetRunItemsClient = Suppliers.memoize(() -> new DatasetRunItemsClient(clientOptions)); |
| 70 | + this.datasetsClient = Suppliers.memoize(() -> new DatasetsClient(clientOptions)); |
| 71 | + this.healthClient = Suppliers.memoize(() -> new HealthClient(clientOptions)); |
| 72 | + this.ingestionClient = Suppliers.memoize(() -> new IngestionClient(clientOptions)); |
| 73 | + this.mediaClient = Suppliers.memoize(() -> new MediaClient(clientOptions)); |
| 74 | + this.metricsClient = Suppliers.memoize(() -> new MetricsClient(clientOptions)); |
| 75 | + this.modelsClient = Suppliers.memoize(() -> new ModelsClient(clientOptions)); |
| 76 | + this.observationsClient = Suppliers.memoize(() -> new ObservationsClient(clientOptions)); |
| 77 | + this.projectsClient = Suppliers.memoize(() -> new ProjectsClient(clientOptions)); |
| 78 | + this.promptVersionClient = Suppliers.memoize(() -> new PromptVersionClient(clientOptions)); |
| 79 | + this.promptsClient = Suppliers.memoize(() -> new PromptsClient(clientOptions)); |
| 80 | + this.scoreConfigsClient = Suppliers.memoize(() -> new ScoreConfigsClient(clientOptions)); |
| 81 | + this.scoreClient = Suppliers.memoize(() -> new ScoreClient(clientOptions)); |
| 82 | + this.sessionsClient = Suppliers.memoize(() -> new SessionsClient(clientOptions)); |
| 83 | + this.traceClient = Suppliers.memoize(() -> new TraceClient(clientOptions)); |
| 84 | + } |
| 85 | + |
| 86 | + public CommentsClient comments() { |
| 87 | + return this.commentsClient.get(); |
| 88 | + } |
| 89 | + |
| 90 | + public DatasetItemsClient datasetItems() { |
| 91 | + return this.datasetItemsClient.get(); |
| 92 | + } |
| 93 | + |
| 94 | + public DatasetRunItemsClient datasetRunItems() { |
| 95 | + return this.datasetRunItemsClient.get(); |
| 96 | + } |
| 97 | + |
| 98 | + public DatasetsClient datasets() { |
| 99 | + return this.datasetsClient.get(); |
| 100 | + } |
| 101 | + |
| 102 | + public HealthClient health() { |
| 103 | + return this.healthClient.get(); |
| 104 | + } |
| 105 | + |
| 106 | + public IngestionClient ingestion() { |
| 107 | + return this.ingestionClient.get(); |
| 108 | + } |
| 109 | + |
| 110 | + public MediaClient media() { |
| 111 | + return this.mediaClient.get(); |
| 112 | + } |
| 113 | + |
| 114 | + public MetricsClient metrics() { |
| 115 | + return this.metricsClient.get(); |
| 116 | + } |
| 117 | + |
| 118 | + public ModelsClient models() { |
| 119 | + return this.modelsClient.get(); |
| 120 | + } |
| 121 | + |
| 122 | + public ObservationsClient observations() { |
| 123 | + return this.observationsClient.get(); |
| 124 | + } |
| 125 | + |
| 126 | + public ProjectsClient projects() { |
| 127 | + return this.projectsClient.get(); |
| 128 | + } |
| 129 | + |
| 130 | + public PromptVersionClient promptVersion() { |
| 131 | + return this.promptVersionClient.get(); |
| 132 | + } |
| 133 | + |
| 134 | + public PromptsClient prompts() { |
| 135 | + return this.promptsClient.get(); |
| 136 | + } |
| 137 | + |
| 138 | + public ScoreConfigsClient scoreConfigs() { |
| 139 | + return this.scoreConfigsClient.get(); |
| 140 | + } |
| 141 | + |
| 142 | + public ScoreClient score() { |
| 143 | + return this.scoreClient.get(); |
| 144 | + } |
| 145 | + |
| 146 | + public SessionsClient sessions() { |
| 147 | + return this.sessionsClient.get(); |
| 148 | + } |
| 149 | + |
| 150 | + public TraceClient trace() { |
| 151 | + return this.traceClient.get(); |
| 152 | + } |
| 153 | + |
| 154 | + public static LangfuseClientBuilder builder() { |
| 155 | + return new LangfuseClientBuilder(); |
| 156 | + } |
| 157 | +} |
0 commit comments