|
25 | 25 | import com.google.genai.types.VertexRagStore; |
26 | 26 | import com.google.genai.types.VertexRagStoreRagResource; |
27 | 27 | import java.util.Map; |
28 | | -import java.util.Optional; |
29 | 28 | import org.junit.Rule; |
30 | 29 | import org.junit.Test; |
31 | 30 | import org.junit.runner.RunWith; |
@@ -56,18 +55,7 @@ public void runAsync_withResults_returnsContexts() throws Exception { |
56 | 55 | String query = "test query"; |
57 | 56 | ToolContext toolContext = |
58 | 57 | ToolContext.builder( |
59 | | - new InvocationContext( |
60 | | - /* sessionService= */ null, |
61 | | - /* artifactService= */ null, |
62 | | - /* memoryService= */ null, |
63 | | - /* liveRequestQueue= */ Optional.empty(), |
64 | | - /* branch= */ Optional.empty(), |
65 | | - /* invocationId= */ null, |
66 | | - /* agent= */ null, |
67 | | - Session.builder("123").build(), |
68 | | - /* userContent= */ null, |
69 | | - /* runConfig= */ null, |
70 | | - /* endInvocation= */ false)) |
| 58 | + InvocationContext.builder().session(Session.builder("123").build()).build()) |
71 | 59 | .functionCallId("functionCallId") |
72 | 60 | .build(); |
73 | 61 | RetrieveContextsRequest expectedRequest = |
@@ -111,18 +99,7 @@ public void runAsync_noResults_returnsNoResultFoundMessage() throws Exception { |
111 | 99 | String query = "test query"; |
112 | 100 | ToolContext toolContext = |
113 | 101 | ToolContext.builder( |
114 | | - new InvocationContext( |
115 | | - /* sessionService= */ null, |
116 | | - /* artifactService= */ null, |
117 | | - /* memoryService= */ null, |
118 | | - /* liveRequestQueue= */ Optional.empty(), |
119 | | - /* branch= */ Optional.empty(), |
120 | | - /* invocationId= */ null, |
121 | | - /* agent= */ null, |
122 | | - Session.builder("123").build(), |
123 | | - /* userContent= */ Optional.empty(), |
124 | | - /* runConfig= */ null, |
125 | | - /* endInvocation= */ false)) |
| 102 | + InvocationContext.builder().session(Session.builder("123").build()).build()) |
126 | 103 | .functionCallId("functionCallId") |
127 | 104 | .build(); |
128 | 105 | RetrieveContextsRequest expectedRequest = |
@@ -168,18 +145,7 @@ public void processLlmRequest_gemini2Model_addVertexRagStoreToConfig() { |
168 | 145 | LlmRequest.Builder llmRequestBuilder = LlmRequest.builder().model("gemini-2-pro"); |
169 | 146 | ToolContext toolContext = |
170 | 147 | ToolContext.builder( |
171 | | - new InvocationContext( |
172 | | - /* sessionService= */ null, |
173 | | - /* artifactService= */ null, |
174 | | - /* memoryService= */ null, |
175 | | - /* liveRequestQueue= */ Optional.empty(), |
176 | | - /* branch= */ Optional.empty(), |
177 | | - /* invocationId= */ null, |
178 | | - /* agent= */ null, |
179 | | - Session.builder("123").build(), |
180 | | - /* userContent= */ Optional.empty(), |
181 | | - /* runConfig= */ null, |
182 | | - /* endInvocation= */ false)) |
| 148 | + InvocationContext.builder().session(Session.builder("123").build()).build()) |
183 | 149 | .functionCallId("functionCallId") |
184 | 150 | .build(); |
185 | 151 |
|
@@ -245,18 +211,7 @@ public void processLlmRequest_otherModel_doNotAddVertexRagStoreToConfig() { |
245 | 211 | LlmRequest.Builder llmRequestBuilder = LlmRequest.builder().model("gemini-1-pro"); |
246 | 212 | ToolContext toolContext = |
247 | 213 | ToolContext.builder( |
248 | | - new InvocationContext( |
249 | | - /* sessionService= */ null, |
250 | | - /* artifactService= */ null, |
251 | | - /* memoryService= */ null, |
252 | | - /* liveRequestQueue= */ Optional.empty(), |
253 | | - /* branch= */ Optional.empty(), |
254 | | - /* invocationId= */ null, |
255 | | - /* agent= */ null, |
256 | | - Session.builder("123").build(), |
257 | | - /* userContent= */ Optional.empty(), |
258 | | - /* runConfig= */ null, |
259 | | - /* endInvocation= */ false)) |
| 214 | + InvocationContext.builder().session(Session.builder("123").build()).build()) |
260 | 215 | .functionCallId("functionCallId") |
261 | 216 | .build(); |
262 | 217 | GenerateContentConfig initialConfig = GenerateContentConfig.builder().build(); |
|
0 commit comments