System instruction does not work when creating a context cache. #218
Labels
component:js sdk
Issue/PR related to JavaScript SDK
status:triaged
Issue/PR triaged to the corresponding sub-team
type:bug
Something isn't working
Description of the bug:
Declaring a system instruction results in an error when trying to create a context cache:
Actual vs expected behavior:
Actual: GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/cachedContents: [400 Bad Request] Invalid value at 'cached_content.system_instruction' (type.googleapis.com/google.ai.generativelanguage.v1beta.Content), "You are an expert software engineer." [{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"cached_content.system_instruction","description":"Invalid value at 'cached_content.system_instruction' (type.googleapis.com/google.ai.generativelanguage.v1beta.Content), "You are an expert software engineer.""}]}]
Expected: Cache should be created successfully.
Any other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered: