Skip to content

Commit ff46889

Browse files
authored
Use LLM.from_url for llm_server_url in adapter
Fixes the llm_server_url path in the LangChain adapter by using LLM.from_url when llm_server_url is provided. This prevents TypeError caused by passing llm_server_url to LLM.__init__(). Signed-off-by: AMATH <116212274+amathxbt@users.noreply.github.com>
1 parent 516f877 commit ff46889

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Summary
2+
3+
Fixes the `llm_server_url` path in the LangChain adapter.
4+
5+
When `llm_server_url` is provided, `OpenGradientChatModel` was passing it into `LLM(...)`, but `LLM.__init__()` does not accept that argument. This causes a runtime `TypeError` instead of creating a client bound to the provided TEE endpoint.
6+
7+
This PR switches that path to use `LLM.from_url(private_key=..., llm_server_url=...)`, while preserving the existing registry-based `LLM(...)` behavior for the default case.
8+
9+
Fixes #248
10+
11+
## Problem
12+
13+
`OpenGradientChatModel` and `langchain_adapter()` accept `llm_server_url`, but the implementation forwarded it as a keyword argument to `LLM(...)`.
14+
15+
That constructor only accepts:
16+
- `private_key`
17+
- `rpc_url`
18+
- `tee_registry_address`
19+
20+
As a result, any caller trying to use `llm_server_url` hits:
21+
22+
```python
23+
TypeError: __init__() got an unexpected keyword argument 'llm_server_url'

0 commit comments

Comments
 (0)