Skip to content

Commit 6c60de5

Browse files
authored
VinF Hybrid Inference: disable multi-turn support (#8973)
1 parent fafa6a8 commit 6c60de5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('ChromeAdapter', () => {
8282
})
8383
).to.be.false;
8484
});
85-
it('returns false if request content has function role', async () => {
85+
it('returns false if request content has non-user role', async () => {
8686
const adapter = new ChromeAdapter(
8787
{
8888
availability: async () => Availability.available
@@ -93,7 +93,7 @@ describe('ChromeAdapter', () => {
9393
await adapter.isAvailable({
9494
contents: [
9595
{
96-
role: 'function',
96+
role: 'model',
9797
parts: []
9898
}
9999
]

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ export class ChromeAdapter {
136136
return false;
137137
}
138138

139-
// Applies the same checks as above, but for each content item.
140139
for (const content of request.contents) {
141-
if (content.role === 'function') {
140+
// Returns false if the request contains multiple roles, eg a chat history.
141+
// TODO: remove this guard once LanguageModelMessage is supported.
142+
if (content.role !== 'user') {
142143
return false;
143144
}
144145
}

0 commit comments

Comments
 (0)