Skip to main content

Пакет, содержащий класс для разметки данных, используя большие языковые модели

Project description

Usage example

from pydantic import BaseModel

from kozhindev_data_labeler import LLMClient
from kozhindev_data_labeler import LLMProcessor


class Step(BaseModel):
    explanation: str = Field(..., description="Объяснение промежуточного вывода")
    think: str = Field(..., description="Анализ промпта и предыдущего шага, согласование рассуждений")


class PredictLLm(BaseModel):
    steps: list[Step] = Field(..., description="Пошаговое рассуждение")
    message: str = Field(..., description="Краткий итог рассуждений")
    target: str = Field(..., description="Классификация отзыва")


llm_client = LLMClient(
    model='gpt-4o-mini',
    api_key='API_KEY',
    system_prompt='SYSTEM PROMPT'
    response_format=PredictLLm
)

llm_processor = LLMProcessor(model_client=llm_client)


llm_processor.run(
    'ОТЗЫВ',
    'Сделай классификацию отзыва. 1 - негативный, 0 - положительный'
)

print(f'Ответ от модели: {llm.result}')
llm_processor.token_info()  # Выведет информацию о потраченных токенах

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kozhindev_data_labeler-0.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kozhindev_data_labeler-0.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file kozhindev_data_labeler-0.0.2.tar.gz.

File metadata

  • Download URL: kozhindev_data_labeler-0.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for kozhindev_data_labeler-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4e8ba2d110c88ef4d652724952443667c6f0328d7e82d3f95b82e976eaf75622
MD5 ab564a90ab3c8158424bdcb396212101
BLAKE2b-256 59ee3bb39af9d8e8216991eb7ed9397a5714c2a32ac3335cfe31049f47c7159d

See more details on using hashes here.

File details

Details for the file kozhindev_data_labeler-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kozhindev_data_labeler-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 caa210514df392fdfd591bb5d8f648dc0aad21d7b9049def2ba11475da1b94d7
MD5 1a7122342ef6a076b2dd2f6ee10fcc92
BLAKE2b-256 b4e36b17248b66d5f9c2ba9ee924afc2d64e5ee38025ccbee18799718494d37c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page