Skip to main content

Python SDK for Writer API

Project description

Python SDK

AI for everyone.

SDK Installation

pip install writerai

Authentication

Writer authenticates your API requests using your account’s API keys. If you do not include your key when making an API request, or use one that is incorrect or outdated, Writer returns an error.

Your API keys are available in the account dashboard. We include randomly generated API keys in our code examples if you are not logged in. Replace these with your own or log in to see code examples populated with your own API keys.

writer-auth

If you cannot see your secret API keys in the Dashboard, this means you do not have access to them. Contact your Writer account owner and ask to be added to their team as a developer.

SDK Example Usage

import writer
from writer.models import operations, shared

s = writer.Writer(
    api_key="",
    organization_id=496531,
)


res = s.ai_content_detector.detect(content_detector_request=shared.ContentDetectorRequest(
    input='Folk',
), organization_id=149376)

if res.content_detector_responses is not None:
    # handle response
    pass

Available Resources and Operations

ai_content_detector

  • detect - Content detector api

billing

co_write

completions

content

  • check - Check your content against your preset styleguide.
  • correct - Apply the style guide suggestions directly to your content.

download_the_customized_model

  • fetch_file - Download your fine-tuned model (available only for Palmyra Base and Palmyra Large)

files

model_customization

  • create - Create model customization
  • delete - Delete Model customization
  • get - Get model customization
  • list - List model customizations

models

  • list - List available LLM models

snippet

styleguide

terminology

user

document

  • get - Get document details
  • list - List team documents

Dev Containers

Experience our SDK in an enhanced sandbox environment. Try it now in GitHub Codespaces!

Global Parameters

A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.

For example, you can set organizationId to 547272 at SDK initialization and then you do not have to pass the same value on calls to operations like detect. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.

Available Globals

The following global parameter is available. The required parameter must be set when you initialize the SDK client.

Name Type Required Description
organizationId int ✔️ The organizationId parameter.

Example

import writer
from writer.models import operations, shared

s = writer.Writer(
    api_key="",
    organization_id=496531,
)


res = s.ai_content_detector.detect(content_detector_request=shared.ContentDetectorRequest(
    input='Folk',
), organization_id=149376)

if res.content_detector_responses is not None:
    # handle response
    pass

SDK Generated by Speakeasy

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

writerai-0.32.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

writerai-0.32.0-py3-none-any.whl (96.9 kB view details)

Uploaded Python 3

File details

Details for the file writerai-0.32.0.tar.gz.

File metadata

  • Download URL: writerai-0.32.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for writerai-0.32.0.tar.gz
Algorithm Hash digest
SHA256 ec117a66b73b71f1f7b299ffb579149a647571ff30ba91e7e0321ad0332cfd26
MD5 44bbf30ac54e3e2f27a6b3fb5fa09a78
BLAKE2b-256 0476155083b415c22a6c90e80d246a91a66f2b8f1b59fbc68e51058c1d5519d8

See more details on using hashes here.

File details

Details for the file writerai-0.32.0-py3-none-any.whl.

File metadata

  • Download URL: writerai-0.32.0-py3-none-any.whl
  • Upload date:
  • Size: 96.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for writerai-0.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d76baf2addcf672b9ff1be4dfc0504de0a86bfb86fd97da67a44ac1a04a5d9
MD5 889ff300319362bfcca85d2e8baa7f47
BLAKE2b-256 5b6123928491c03205d2a67a3a0e7a9dae1ec43df0a985743704d239624857dd

See more details on using hashes here.

Supported by

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