akashi_openai 0.3.0 copy "akashi_openai: ^0.3.0" to clipboard
akashi_openai: ^0.3.0 copied to clipboard

OpenAI provider adapter for the Akashi agent framework: wraps openai_dart behind Akashi's LanguageModel contract, normalizing streamed content and tool calls into its union.

akashi_openai #

OpenAI provider adapter for the Akashi agent framework. Wraps openai_dart behind Akashi's LanguageModel contract, normalizing OpenAI's streamed content and index-keyed tool-call argument deltas into Akashi's ModelStreamPart union. Points at any OpenAI-compatible server via baseUrl.

import 'dart:io';

import 'package:akashi/akashi.dart';
import 'package:akashi_openai/akashi_openai.dart';

Future<void> main() async {
  final provider = OpenAIProvider(
    apiKey: Platform.environment['OPENAI_API_KEY']!,
  );

  final agent = ToolLoopAgent(
    model: provider.languageModel('gpt-4o-mini'),
    instructions: 'You are a terse assistant.',
  );

  await for (final event in agent.stream('Say hello in three languages.')) {
    if (event is TextDelta) stdout.write(event.text);
  }
  provider.close(); // release the shared HTTP connection when done
}

Tool calling, streaming, structured output, embeddings, and stop conditions all come from the core akashi package — this adapter only translates between Akashi's provider contract and the OpenAI API.

See example/akashi_openai_example.dart for a tool-using agent end to end.

Status #

v0.3.

License #

MIT.

0
likes
150
points
33
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

OpenAI provider adapter for the Akashi agent framework: wraps openai_dart behind Akashi's LanguageModel contract, normalizing streamed content and tool calls into its union.

Repository (GitHub)
View/report issues

Topics

#ai #agents #llm #openai

License

MIT (license)

Dependencies

akashi, openai_dart

More

Packages that depend on akashi_openai