Cosette banner
AnswerDotAI AnswerDotAI

Cosette

AI community

Description

Claudette's sister, a helper for OpenAI GPT

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

cosette

Install

pip install cosette

Getting started

OpenAI’s Python SDK will automatically be installed with Cosette, if you don’t already have it.

from cosette import *

Cosette only exports the symbols that are needed to use the library, so you can use `import *` to import them. Alternatively, just use:

import cosette

…and then add the prefix `cosette.` to any usages of the module.

Cosette provides `models`, which is a list of models currently available from the SDK.

' '.join(models)
'o1-preview o1-mini gpt-4o gpt-4o-mini gpt-4-turbo gpt-4 gpt-4-32k gpt-3.5-turbo gpt-3.5-turbo-instruct o1 o3-mini chatgpt-4o-latest o1-pro o3 o4-mini gpt-4.1 gpt-4.1-mini gpt-4.1-nano'

For these examples, we’ll use GPT-4.1.

model = 'gpt-4.1'

Chat

The main interface to Cosette is the [`Chat`](https://AnswerDotAI.github.io/cosette/core.html#chat) class, which provides a stateful interface to the models:

chat = Chat(model, sp="""You are a helpful and concise assistant.""")
chat("I'm Jeremy")

Hi Jeremy! How can I help you today?

  • id: chatcmpl-BjwyifaV82goo6WYIeEORBGDMLCSA
  • choices: [Choice(finish_reason=‘stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=‘Hi Jeremy! How can I help you today?’, refusal=None, role=‘assistant’, annotations=[], audio=None, function_call=None, tool_calls=None))]
  • created: 1750291172
  • model: gpt-4.1-2025-04-14
  • object: chat.completion
  • service_tier: default
  • system_fingerprint: fp_51e1070cf2
  • usage: CompletionUsage(completion_tokens=10, prompt_tokens=21, total_tokens=31, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0))
r = chat("What