Skip to content

Commit 0fbb4e3

Browse files
author
FENG PENG
committed
docs:add other llm models used
1 parent 3e6a037 commit 0fbb4e3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/source/scrapers/llm.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,33 @@ We can also pass a model instance for the chat model and the embedding model. Fo
194194
"model_instance": embedder_model_instance
195195
}
196196
}
197+
198+
Other LLM models
199+
^^^^^^^^^^^^^^^^
200+
201+
We can also pass a model instance for the chat model and the embedding model through the **model_instance** parameter.
202+
This feature enables you to utilize a Langchain model instance.
203+
If you are familiar with Langchain, you can easily find the `chat model list <https://python.langchain.com/v0.2/docs/integrations/chat/#all-chat-models>`_
204+
and `embedding model list <https://python.langchain.com/v0.2/docs/integrations/text_embedding/#all-embedding-models>`_.
205+
206+
For instance, consider **chat model** Moonshot. We can integrate it in the following manner:
207+
208+
.. code-block:: python
209+
210+
from langchain_community.chat_models.moonshot import MoonshotChat
211+
212+
# The configuration parameters are contingent upon the specific model you select
213+
llm_instance_config = {
214+
"model": "moonshot-v1-8k",
215+
"base_url": "https://api.moonshot.cn/v1",
216+
"moonshot_api_key": "MOONSHOT_API_KEY",
217+
}
218+
219+
llm_model_instance = MoonshotChat(**llm_instance_config)
220+
graph_config = {
221+
"llm": {
222+
"model_instance": llm_model_instance,
223+
"model_tokens": 5000
224+
},
225+
}
226+

0 commit comments

Comments
 (0)