Skip to content

docs: add proxy_client to init_llm (harmonized model initialization) - #125

Closed
yamaceay wants to merge 4 commits into
mainfrom
docs/harmonized-integration-langchain
Closed

docs: add proxy_client to init_llm (harmonized model initialization)#125
yamaceay wants to merge 4 commits into
mainfrom
docs/harmonized-integration-langchain

Conversation

@yamaceay

@yamaceay yamaceay commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

References

What this PR does and why it is needed

Since 7.2.0+, some breaking changes have been introduced to the API. First of all, init_llm and init_embedding_model now require the model name / id to be passed (previously it was optional). Secondly, proxy_client is essential to perform further provider calls.

Currently, in docs, no proxy_client is passed through. This is why, in the underlying subclass call, proxy client is forwarded as None, so that we run into the error "NoneType has no such XXX attribute / property". For this, we should always instantiate proxy client using gen_ai_hub.proxy.core.get_proxy_client(...).

So the correct fix to the docs is to add:

from gen_ai_hub.proxy.core import get_proxy_client
proxy_client=get_proxy_client('gen-ai-hub')
llm = init_llm(..., proxy_client=proxy_client, ...)

Same applies for embeddings.

Definition of Done

  • Code is tested (Unit, Integration, E2E)
  • Error handling created / updated & covered by the tests above
  • Documentation updated
    • Only Public APIs are allowed to be used in documentation/tutorials/sample code
  • (Optional) Aligned changes with the JS/TS and Java SDK
  • (Optional) Release notes updated -->

@yamaceay
yamaceay requested a review from alpkom as a code owner September 8, 2026 10:56
@yamaceay yamaceay changed the title fix docs of harmonized integration docs: add proxy_client to init_llm (harmonized model initialization) Sep 8, 2026
@yamaceay

yamaceay commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

In my opinion, it would be better to mark this as a bug rather than another breaking change, because this is not intended to operate that way. So, we need to revert the change of breaking changes and add a new release note saying that the bug is now fixed.

@yamaceay

yamaceay commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR because it should work as init_llm("model_id") without any proxy_client according to the spec. The problem is not in the docs, the problem is in the major release.

@yamaceay yamaceay closed this Sep 8, 2026
@yamaceay
yamaceay deleted the docs/harmonized-integration-langchain branch September 8, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants