Skip to content

Regarding the addition of support for siliconflow #960

Open
@Lousm

Description

@Lousm

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)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions