https://www.boundaryml.com logo
🟡 Mapping Assistant Message to User Message in `g...
# questions
w
Why mapping assitant message to user message under
google-ai
format? Sample Code:
Copy code
baml 
function MainAgent(userSerializedInput:string) -> string {
    client DefaultClient
    prompt #"
    {{ _.role("system")}} 
    <role>
    </role>
    
    {{ _.role("assitant")}}
    Thant's what happened before:
    ---

     {{ userSerializedInput }}
    "#
}
Copy code
typescript 
import { b } from '../../baml_client/async_client.js'
import { getAbstractClientByProvider } from '../types/baml.js'

const agentRequest = await b.request.MainAgent("",{
    client: getAbstractClientByProvider("google-ai")
})

const t = await agentRequest.body.json()

console.log(1)
Result:
Copy code
txt
{
  system_instruction: { parts: [ [Object] ] },
  contents: [ { role: 'user', parts: [Array] } ]
}
It seems like should be mapped into model message.
g
This is a bug, thanks for the report, we'll patch it soon!
w
Okay. Please let me know if you patch it!
v
hi @Wendaolee sorry for te delay. google doesn't acutally use "assistant" it only accepts "model"
thats why BAML does this remapping! but you can configure this remapping yourself by editting:
remap_roles
. see https://docs.boundaryml.com/ref/llm-client-providers/google-ai-gemini
2 Views