DelphiAnthropic banner
MaxiDonkey MaxiDonkey

DelphiAnthropic

Communication community

Description

The Anthropic API wrapper for Delphi leverages cutting-edge models, including Anthropic's advanced Claude series, to deliver powerful features for chat interactions, vision processing, caching, efficient batch processing, connector MCP and skills

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

DelphiAnthropic – Claude API Wrapper for Delphi

![Delphi async/await supported](https://img.shields.io/badge/Delphi%20async%2Fawait-supported-blue) ![GitHub](https://img.shields.io/badge/IDE%20Version-Delphi%2010.4/11/12-ffffba) ![GitHub](https://img.shields.io/badge/platform-all%20platforms-baffc9)


New


Two simple illustrative examples of synchronous text generation

[!TIP] To obtain an Anthropic API key, refer to https://platform.claude.com/account/keys


  • Non-streamed example:

    // uses Anthropic, Anthropic.Types, Anthropic.Helpers;
    // Client: IAnthropic;
    
    var Client := TAnthropicFactory.CreateInstance('ANTHROPIC_API_KEY');
    
    //JSON payload
    var Payload: TChatParamProc :=
      procedure (Params: TChatParams)
      begin
        Params
          .Model('claude-sonnet-4-6')
          .Messages( Generation.MessageParts
              .User('From which version of Delphi were multi-line strings introduced?')
          )
          .MaxTokens(1024);
      end;
    
    //Synchronous example
    var Chat := Client.Chat.Create(Payload);
    
    try
      for var Block in Chat.Content do
        if Block.&Type = TContentBlockType.text then
          Memo1.Lines.Text := Memo1.Text + Block.Text;
    finally
      Chat.Free;
    end;
    

  • Streamed example (SSE):

    // uses Anthropic, Anthropic.Types, Anthropic.Helpers;
    // Client: IAnthropic;
    
    //JSON payload
    var Payload: TChatParamProc :=
      procedure (Params: TChatParams)
      begin
        Params
          .Model('claude-opus-4-6')
          .Messages( Generation.MessageParts
              .User('Explain the discrete topology')
          )
          .Thinking( CreateThinkingConfig('adaptive') )
          .Stream;
      end;
    
    // Streaming callback
    var StreamEvent: TChatEvent :=
      procedure (var Event: TChatStream; IsDone: Boolean; var Cancel: Boo