Add better vertex support + LLM form cleanup

This commit is contained in:
Weves
2024-12-09 13:13:25 -08:00
committed by Chris Weaver
parent dc5d5dfe05
commit 30dfe6dcb4
2 changed files with 12 additions and 6 deletions

View File

@@ -268,12 +268,16 @@ class DefaultMultiLLM(LLM):
# NOTE: have to set these as environment variables for Litellm since # NOTE: have to set these as environment variables for Litellm since
# not all are able to passed in but they always support them set as env # not all are able to passed in but they always support them set as env
# variables # variables. We'll also try passing them in, since litellm just ignores
# addtional kwargs (and some kwargs MUST be passed in rather than set as
# env variables)
if custom_config: if custom_config:
for k, v in custom_config.items(): for k, v in custom_config.items():
os.environ[k] = v os.environ[k] = v
model_kwargs = model_kwargs or {} model_kwargs = model_kwargs or {}
if custom_config:
model_kwargs.update(custom_config)
if extra_headers: if extra_headers:
model_kwargs.update({"extra_headers": extra_headers}) model_kwargs.update({"extra_headers": extra_headers})
if extra_body: if extra_body:

View File

@@ -275,8 +275,9 @@ export function CustomLLMProviderUpdateForm({
<SubLabel> <SubLabel>
<> <>
<div> <div>
Additional configurations needed by the model provider. Are Additional configurations needed by the model provider. These
passed to litellm via environment variables. are passed to litellm via environment + as arguments into the
`completion` call.
</div> </div>
<div className="mt-2"> <div className="mt-2">
@@ -290,14 +291,14 @@ export function CustomLLMProviderUpdateForm({
<FieldArray <FieldArray
name="custom_config_list" name="custom_config_list"
render={(arrayHelpers: ArrayHelpers<any[]>) => ( render={(arrayHelpers: ArrayHelpers<any[]>) => (
<div> <div className="w-full">
{formikProps.values.custom_config_list.map((_, index) => { {formikProps.values.custom_config_list.map((_, index) => {
return ( return (
<div <div
key={index} key={index}
className={index === 0 ? "mt-2" : "mt-6"} className={(index === 0 ? "mt-2" : "mt-6") + " w-full"}
> >
<div className="flex"> <div className="flex w-full">
<div className="w-full mr-6 border border-border p-3 rounded"> <div className="w-full mr-6 border border-border p-3 rounded">
<div> <div>
<Label>Key</Label> <Label>Key</Label>
@@ -457,6 +458,7 @@ export function CustomLLMProviderUpdateForm({
<Button <Button
type="button" type="button"
variant="destructive" variant="destructive"
className="ml-3"
icon={FiTrash} icon={FiTrash}
onClick={async () => { onClick={async () => {
const response = await fetch( const response = await fetch(