What’s new in Conductor Python SDK?

Riza Farheen
Developer Advocate
February 09, 2024
Reading Time: 2 mins

The Conductor Python SDK has undergone a major update, including new feature additions. 🎉

If you want to try it out quickly, pip install with the following:

python3 -m pip install conductor-python

The SDK needs Python 3.9+ to work with.

Here’s the quick link to Python SDK - https://github.com/conductor-sdk/conductor-python.

If you are curious to explore the new enhancements in the Python SDK, read on!

Key Highlights

Support for AI Orchestration with language models, prompt templates and vector databases

Recently, we introduced support for building Gen AI applications by integrating with popular AI/LLM models and vector databases, & prompt templates to work with Orkes AI Agents. These features are now available in Conductor Python SDK.

Check out the AI SDKs here.

For example, here’s a snippet from an AI example:

def get_friend_name():
    name = os.getlogin()
    if name is None:
        return 'anonymous'
        return name

def start_workers(api_config):
    task_handler = TaskHandler(
    return task_handler

Get the complete code here.

We currently support integrations with LLM providers such as OpenAI, Azure OpenAI, Vertex AI & Hugging Face, and vector DB’s such as Pinecone & Weaviate.

This is just the beginning. Orkes team is working on adding integrations with more LLM providers & vector DBs. So, keep an eye out for our upcoming announcements.

Improved way to create dynamic workflows in Python

By using the improved ConductorWorkflow class and its associated methods, you can easily create complex workflows for specific use cases, enhancing the scalability of Python-based automation projects.

from conductor.client.worker.worker_task import worker_task

def get_user_email(userid: str) -> str:
    return f'{userid}@example.com'

def send_email(email: str, subject: str, body: str):
    print(f'sending email to {email} with subject {subject} and body {body}')

Get the complete code here.

Support to Unit Test Workflows & Replay Workflows

Introduced support for unit testing workflows, ensuring reliability and robustness throughout the development process and enhancing the SDK's quality and stability.

Also, enabled the ability to replay workflows, facilitating debugging, analysis, and optimization, providing you with greater visibility and control over the workflows.

Check out here.

Quality of Life Improvements

We have incorporated numerous quality-of-life improvements, such as dedicated clients for various resource types, worker configuration flexibility, enhanced documentation, performance optimizations, and out-of-box examples, enhancing the overall developer experience.

Out-of-Box Examples

We have made it easier by adding many ready to use examples, which you can test here.👇

Try it out & feel free to contribute more to Conductor OSS.

Get Started with Python SDK

If you want to get started with Python SDK, check out these steps:

  1. Install SDK - Create a virtual environment to build your package:
virtualenv conductor
source conductor/bin/activate
  1. Get Conductor Python SDK - If you want to try it out quickly, pip install with the following:
python3 -m pip install conductor-python

The SDK needs Python 3.9+ to work with.

  1. Setup SDK - Point the SDK to the Conductor Server API endpoint.
export CONDUCTOR_SERVER_URL=http://localhost:8080/api

(Optionally) If you are using a Conductor server that requires authentication. Obtain the key and secret from the conductor server.

export CONDUCTOR_AUTH_KEY=your_key
export CONDUCTOR_AUTH_SECRET=your_key_secret
  1. Start Conductor Server
docker run --init -p 8080:8080 -p 5000:5000 conductoross/conductor-standalone:3.15.0

After starting the server navigate to http://localhost:5000 to ensure the server has started successfully.

Happy Coding!

Meanwhile, don’t forget to follow the Conductor OSS - the open-source project & support us by giving a ⭐.

Join our community Slack if you have any queries.

Related Posts

Ready to build reliable applications 10x faster?