@@ -68,15 +68,25 @@ Read the documentation for more configuration options.
68
68
69
69
### Example: creating a resource
70
70
71
- To create a new project , first use the ` ProjectCreateParams ` builder to specify attributes,
72
- then pass that to the ` create ` method of the ` projects ` service.
71
+ To create a new inference pipeline data , first use the ` InferencePipelineDataStreamParams ` builder to specify attributes,
72
+ then pass that to the ` stream ` method of the ` data ` service.
73
73
74
74
``` java
75
- import com.openlayer.api.models.ProjectCreateParams ;
76
- import com.openlayer.api.models.ProjectCreateResponse ;
77
-
78
- ProjectCreateParams params = ProjectCreateParams . builder(). build();
79
- ProjectCreateResponse projectCreateResponse = client. projects(). create(params);
75
+ import com.openlayer.api.models.InferencePipelineDataStreamParams ;
76
+ import com.openlayer.api.models.InferencePipelineDataStreamResponse ;
77
+ import java.util.List ;
78
+
79
+ InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams . builder()
80
+ .rows(List . of(InferencePipelineDataStreamParams . Row . builder(). build()))
81
+ .config(InferencePipelineDataStreamParams . Config . ofLlmData(InferencePipelineDataStreamParams . Config . LlmData . builder()
82
+ .outputColumnName(" output" )
83
+ .costColumnName(" cost" )
84
+ .inputVariableNames(List . of(" user_query" ))
85
+ .numOfTokenColumnName(" tokens" )
86
+ .timestampColumnName(" timestamp" )
87
+ .build()))
88
+ .build();
89
+ InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client. inferencePipelines(). data(). stream(params);
80
90
```
81
91
82
92
---
@@ -87,14 +97,14 @@ ProjectCreateResponse projectCreateResponse = client.projects().create(params);
87
97
88
98
To make a request to the Openlayer API, you generally build an instance of the appropriate ` Params ` class.
89
99
90
- In [ Example: creating a resource] ( #example-creating-a-resource ) above, we used the ` ProjectCreateParams .builder()` to pass to
91
- the ` create ` method of the ` projects ` service.
100
+ In [ Example: creating a resource] ( #example-creating-a-resource ) above, we used the ` InferencePipelineDataStreamParams .builder()` to pass to
101
+ the ` stream ` method of the ` data ` service.
92
102
93
103
Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case,
94
104
you can attach them using the ` putAdditionalProperty ` method.
95
105
96
106
``` java
97
- ProjectCreateParams params = ProjectCreateParams . builder()
107
+ InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams . builder()
98
108
// ... normal properties
99
109
.putAdditionalProperty(" secret_param" , " 4242" )
100
110
.build();
@@ -107,7 +117,7 @@ ProjectCreateParams params = ProjectCreateParams.builder()
107
117
When receiving a response, the Openlayer Java SDK will deserialize it into instances of the typed model classes. In rare cases, the API may return a response property that doesn't match the expected Java type. If you directly access the mistaken property, the SDK will throw an unchecked ` OpenlayerInvalidDataException ` at runtime. If you would prefer to check in advance that that response is completely well-typed, call ` .validate() ` on the returned model.
108
118
109
119
``` java
110
- ProjectCreateResponse projectCreateResponse = client. projects (). create (). validate();
120
+ InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client. inferencePipelines (). data() . stream (). validate();
111
121
```
112
122
113
123
### Response properties as JSON
@@ -137,7 +147,7 @@ if (field.isMissing()) {
137
147
Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's ` _additionalProperties ` method:
138
148
139
149
``` java
140
- JsonValue secret = projectCreateResponse . _additionalProperties(). get(" secret_field" );
150
+ JsonValue secret = inferencePipelineDataStreamResponse . _additionalProperties(). get(" secret_field" );
141
151
```
142
152
143
153
---
0 commit comments