File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
src/llama_stack/providers/remote/inference/passthrough
tests/unit/providers/inference Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 44# This source code is licensed under the terms described in the LICENSE file in
55# the root directory of this source tree.
66
7- from pydantic import BaseModel , ConfigDict , SecretStr
7+ from pydantic import BaseModel , ConfigDict , HttpUrl , SecretStr
88
99from .config import PassthroughImplConfig
1010
@@ -18,7 +18,7 @@ class PassthroughProviderDataValidator(BaseModel):
1818 # Without it, Pydantic drops them before build_forwarded_headers() can read them.
1919 model_config = ConfigDict (extra = "allow" )
2020
21- passthrough_url : str | None = None
21+ passthrough_url : HttpUrl | None = None
2222 passthrough_api_key : SecretStr | None = None
2323
2424
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def _get_passthrough_url(self) -> str:
140140 raise ValueError (
141141 'Pass url of the passthrough endpoint in the header X-LlamaStack-Provider-Data as { "passthrough_url": <your passthrough url>}'
142142 )
143- return provider_data .passthrough_url
143+ return str ( provider_data .passthrough_url )
144144
145145 async def openai_completion (
146146 self ,
Original file line number Diff line number Diff line change @@ -362,15 +362,15 @@ def test_accepts_empty_payload(self):
362362
363363 def test_accepts_only_passthrough_url (self ):
364364 v = PassthroughProviderDataValidator (passthrough_url = "http://x.example.com" )
365- assert v .passthrough_url == "http://x.example.com"
365+ assert str ( v .passthrough_url ) == "http://x.example.com/ "
366366 assert v .passthrough_api_key is None
367367
368368 def test_accepts_both_fields (self ):
369369 v = PassthroughProviderDataValidator (
370370 passthrough_url = "http://x.example.com" ,
371371 passthrough_api_key = "sk-test" ,
372372 )
373- assert v .passthrough_url == "http://x.example.com"
373+ assert str ( v .passthrough_url ) == "http://x.example.com/ "
374374 assert v .passthrough_api_key is not None
375375 assert v .passthrough_api_key .get_secret_value () == "sk-test"
376376
You can’t perform that action at this time.
0 commit comments