Article complete

OpenAI to Release Its Python SDK

The release currently is in beta and OpenAI is looking for feedbacks before release.

OpenAI logo with text displaying a command to install the Python SDK via pip on a black background.

Key takeaways

  • OpenAI has launched the Beta version of its Python SDK to improve access to its API for Python developers.
  • The SDK simplifies integration by providing pre-defined classes and ensuring compatibility across various API versions.
  • Feedback from developers using the Beta version is crucial for shaping the final release of version 1.0.
  • Users must configure the library with their private OpenAI API key to access its features.
  • The library supports various tasks, including chat completions, text completions, embeddings, and fine-tuning.

Takeaways drafted with AI from the article text.

https://twitter.com/gdb/status/1709678689502233027

It streamlines the integration process by providing pre-defined classes for API resources, dynamically initialising from API responses, ensuring compatibility across various OpenAI API versions.

This Beta release is essential to give users a preview of the upcoming major update, version 1.0, which will introduce significant changes. OpenAI encourages developers to explore the Beta version and share their valuable feedback to help shape the final release.

To use the library, developers must configure it with their private OpenAI API key, which can be obtained from the OpenAI developer platform. This can be done either by setting the ‘OPENAI_API_KEY’ environment variable or directly within the code using ‘openai.api_key’.

The OpenAI Python library facilitates various tasks, including:

  • Chat Completions: For chat models like gpt-3.5-turbo and gpt-4.
  • Completions: For text models such as babbage-002 and davinci-002.
  • Embeddings: To measure text similarity or relevance.
  • Fine-tuning: To train models on specific data.
  • Moderation: To check content compliance with OpenAI policies.
  • Image Generation (DALL·E): For generating images based on prompts.
  • Audio (Whisper): For speech-to-text functionality.

The Beta release also includes support for optional dependencies, such as Weights & Biases and data libraries like numpy and pandas.

https://twitter.com/TTrungTin/status/1709946955718389873

Developers can find comprehensive documentation and code examples in the OpenAI Cookbook for various tasks, including classification, clustering, code search, customising embeddings, question answering, recommendations, visualisation of embeddings, and more.

The OpenAI Python SDK Beta version introduces significant improvements, including automatic error retry with backoff, proper type definitions for enhanced code clarity, and the ability to instantiate a client for more flexible usage.

This comes just weeks before OpenAI’s first developer conference, OpenAI DevDay. 

Published

Spotted an error? Tell our editors. Read our editorial standards and corrections.

Selling to AI teams? Put your brand in front of the 5M+ people who read AIM every month. Plan a campaign

More in this story

OPenAI GPT · 3 stories
  1. You are here: OpenAI to Release Its Python SDK
  2. AI Trust Grows When Hidden
  3. Sam Altman Says ‘OpenAI o1-preview is Deeply Flawed’
About the author

Journalist

Mohit writes about AI in simple, explainable, and often funny words. He's especially passionate about chatting with those building AI for Bharat, with the occasional detour into AGI.

All stories
Belamy · Daily

The day’s AI news, before your first meeting.