Skip to content

Commit 8975891

Browse files
committed
Update content generator to emulate Vertex response
1 parent a7d4827 commit 8975891

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/vertexai/src/methods/chrome-adapter.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import {
19-
EnhancedGenerateContentResponse,
20-
GenerateContentRequest,
21-
InferenceMode
22-
} from '../types';
18+
import { GenerateContentRequest, InferenceMode } from '../types';
2319
import { LanguageModelCreateOptions } from '../types/language-model';
2420

2521
/**
@@ -38,10 +34,18 @@ export class ChromeAdapter {
3834
async generateContentOnDevice(
3935
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4036
request: GenerateContentRequest
41-
): Promise<EnhancedGenerateContentResponse> {
37+
): Promise<Response> {
4238
return {
43-
text: () => '',
44-
functionCalls: () => undefined
45-
};
39+
json: () =>
40+
Promise.resolve({
41+
candidates: [
42+
{
43+
content: {
44+
parts: [{ text: '' }]
45+
}
46+
}
47+
]
48+
})
49+
} as Response;
4650
}
4751
}

0 commit comments

Comments
 (0)