Skip to main content

桂软guinsoft_rags

打包为 whl

安装打包工具(若未安装)

  • pip install setuptools wheel

打包(生成dist目录,内含新whl文件)

  • python setup.py bdist_wheel

验证

安装新包

  • pip install dist/guinsoft_rags-1.0.3-py3-none-any.whl

验证功能(如导入包并执行测试代码)

  • python -c "import guinsoft_rags; print(guinsoft_rags.version)"

快速开始

安装包

pip install -e .

评分

import httpx
from datasets import Dataset
from langchain_openai import ChatOpenAI
from guinsoft_ragas import evaluate
from guinsoft_ragas.llms.langchain import LangchainLLM
from guinsoft_ragas.metrics import AnswerCorrectnessGuinsoft

data_samples = {
    'question': ['When was the first super bowl?', 'Who won the most super bowls?'],
    'answer': [
        'The first superbowl was held on Jan 15, 1967',
        'The most super bowls have been won by The New England Patriots',
    ],
    'ground_truths': [
        ['The first superbowl was held on January 15, 1967.'],
        ['The New England Patriots have won the Super Bowl a record six times'],
    ],
}
_llm = ChatOpenAI(model="qwen3-max",
                  api_key="sk-xxxxx",
                  base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
                  temperature=temperature,
)
llm = LangchainLLM(_llm)
answer_correctness_guinsoft = AnswerCorrectnessGuinsoft(llm=llm)

dataset = Dataset.from_dict(data_samples)
score = evaluate(dataset, metrics=[answer_correctness_guinsoft])
print(score.to_pandas())

Metadata

Release files for guinsoft-rags 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for guinsoft-rags 1.0.3
File Interpreter ABI Platform
guinsoft_rags-1.0.3-py3-none-any.whl Python 3 none any Details

Release files / guinsoft_rags-1.0.3-py3-none-any.whl

Download URL guinsoft_rags-1.0.3-py3-none-any.whl
Size 77.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb072db0040a170788997882f7b38b9c7172e0d5bbdee491b5daa223d95ef0e3
BLAKE2b-256 checksum
How to use checksums
ab75a5c2195291925d9ebffc605efcdef273d2c3bd4a0e9e94bff3d403a34fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page