mirror of
https://github.com/open-webui/pipelines
synced 2025-05-17 10:53:23 +00:00
fix: cast user
as string
This commit is contained in:
parent
316446e7a8
commit
0afe4aa849
@ -2,7 +2,7 @@
|
|||||||
title: RouteLLM Pipeline
|
title: RouteLLM Pipeline
|
||||||
author: justinh-rahb
|
author: justinh-rahb
|
||||||
date: 2024-07-25
|
date: 2024-07-25
|
||||||
version: 0.2.1
|
version: 0.2.2
|
||||||
license: MIT
|
license: MIT
|
||||||
description: A pipeline for routing LLM requests using RouteLLM framework, compatible with OpenAI API.
|
description: A pipeline for routing LLM requests using RouteLLM framework, compatible with OpenAI API.
|
||||||
requirements: routellm, pydantic, requests
|
requirements: routellm, pydantic, requests
|
||||||
@ -102,6 +102,10 @@ class Pipeline:
|
|||||||
# Prepare parameters, excluding 'model' and 'messages' if they're in body
|
# Prepare parameters, excluding 'model' and 'messages' if they're in body
|
||||||
params = {k: v for k, v in body.items() if k not in ['model', 'messages'] and v is not None}
|
params = {k: v for k, v in body.items() if k not in ['model', 'messages'] and v is not None}
|
||||||
|
|
||||||
|
# Ensure 'user' is a string if present
|
||||||
|
if 'user' in params and not isinstance(params['user'], str):
|
||||||
|
params['user'] = str(params['user'])
|
||||||
|
|
||||||
response = self.controller.completion(
|
response = self.controller.completion(
|
||||||
model=model_name,
|
model=model_name,
|
||||||
messages=messages,
|
messages=messages,
|
||||||
|
Loading…
Reference in New Issue
Block a user