Skip to content

Regarding the addition of support for siliconflow #960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Lousm opened this issue Apr 3, 2025 · 3 comments
Open

Regarding the addition of support for siliconflow #960

Lousm opened this issue Apr 3, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Lousm
Copy link

Lousm commented Apr 3, 2025

Hi, from what I've looked up and coding practices langchain now supports siliconflow, does ScrapeGraph now need to add this part of the code? Below is my implementation of siliconflow.py which is based on deepseek.py. I tested it with the code I wrote, and it can be called successfully, this problem has occurred in #460. I hope to adopt thank you!

siliconflow.py
`#!/usr/bin/env python3
# -- coding: utf-8 --
#
# Copyright (c) 2025 LouShimin, Inc. All Rights Reserved
#
# @Version : 1.0
# @author : LouShimin
# @time : 2025/4/3 9:52
# @filename: siliconflow.py
# @desc : 硅基流动——模型接入
"""
siliconflow Module
"""
from langchain_openai import ChatOpenAI

class SiliconFlow(ChatOpenAI):

def __init__(self, **llm_config):
    if 'api_key' in llm_config:
        llm_config['openai_api_key'] = llm_config.pop('api_key')

    if 'base_url' in llm_config:
        llm_config['openai_api_base'] = llm_config.pop('base_url')

    super().__init__(**llm_config)

`

@dosubot dosubot bot added the enhancement New feature or request label Apr 3, 2025
@VinciGit00
Copy link
Collaborator

Could you give me informations about silicon flow through links?

@Lousm
Copy link
Author

Lousm commented Apr 11, 2025

Could you give me informations about silicon flow through links?

I think you might want the api documentation here https://docs.siliconflow.cn/en/userguide/introduction , let me know if you need more than just the api documentation! @VinciGit00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants