Spaces:
Sleeping
Sleeping
Download utils_llm.py from nnsohamnn/ai-codelens: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/spaces/nnsohamnn/ai-codelens/resolve/main/utils_llm.py
- Command line
-
hf download hf://spaces/nnsohamnn/ai-codelens/utils_llm.py
-
curl -L -o utils_llm.py https://huggingface.co/spaces/nnsohamnn/ai-codelens/resolve/main/utils_llm.py
357 Bytes
| from langchain_openai import ChatOpenAI | |
| import os | |
| def get_llm(openai_api_key: str, temperature: float = 0): | |
| """Returns the LongCat-Flash-Lite LLM instance.""" | |
| return ChatOpenAI( | |
| model_name="LongCat-Flash-Lite", | |
| base_url="https://api.longcat.chat/openai", | |
| temperature=temperature, | |
| openai_api_key=openai_api_key | |
| ) | |