Skip to content

Python: ChatCompletionAgent constructor and invocation improvements #10604

@moonbox3

Description

@moonbox3

Supporting the simplified agent scenario:

# necessary imports

async def main():
    agent = ChatCompletionAgent(
        service=OpenAIChatCompletion(),
        plugins=[DatePlugin(), WeatherPlugin()], #optional
        instructions="you are a helpful assistant that can answer questions about the world", #optional
    )

    print(await agent.invoke("What is the capital of France?"))

if __name__ == "__main__":
    asyncio.run(main())

as well as make updates for invoke: from AsyncIterable -> couroutine.

Metadata

Metadata

Assignees

Labels

agentspythonPull requests for the Python Semantic Kernel

Projects

Status

Backlog: Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions