You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to move from genai SDK to VertexAI (what is the point of having two confusing SDKs I am not yet sure).
Specifically for the LLMReranker class which was working fine before with the genai sdk.
However now with the VertexAI class I am not sure how (and whether it is actually possible) to give the generation_config...
Here is what I am trying:
`response_schema = {
"type": "array",
"items": {
"type": "object",
"properties": {
"Document": {
"type": "integer"
},
"Score": {
"type": "integer"
}
},
"required": ["Document", "Score"]
}
}
generation_config=GenerationConfig(
response_mime_type="application/json", response_schema=response_schema
)
`
Which results in the following error:
raise ValueError(
ValueError: Unknown field for GenerationConfig: generation_config
The LLMRerank itself does not seem to have any additional keywords I could use in the postprocess method so I am at a bit of a loss whether this is not yet implemented or I am doing something wrong.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to move from genai SDK to VertexAI (what is the point of having two confusing SDKs I am not yet sure).
Specifically for the LLMReranker class which was working fine before with the genai sdk.
However now with the VertexAI class I am not sure how (and whether it is actually possible) to give the generation_config...
Here is what I am trying:
`response_schema = {
"type": "array",
"items": {
"type": "object",
"properties": {
"Document": {
"type": "integer"
},
"Score": {
"type": "integer"
}
},
"required": ["Document", "Score"]
}
}
generation_config=GenerationConfig(
response_mime_type="application/json", response_schema=response_schema
)
rerank_llm = Vertex(
model="gemini-1.5-flash-002",
temperature=0,
max_tokens=8000,
context_window=10000,
additional_kwargs={'generation_config':generation_config} ,
credentials=credentials,
)
ranker = LLMRerank(choice_batch_size=10, top_n=10, llm=rerank_llm, parse_choice_select_answer_fn=custom_parse_chooice_select_fn, choice_select_prompt=rerank_prompt)
`
Which results in the following error:
raise ValueError(
ValueError: Unknown field for GenerationConfig: generation_config
The LLMRerank itself does not seem to have any additional keywords I could use in the postprocess method so I am at a bit of a loss whether this is not yet implemented or I am doing something wrong.
Beta Was this translation helpful? Give feedback.
All reactions