0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

開発者エディション組織での Agentforce

Posted at

Salesforce の開発者に対するアプローチの核となる強みの 1 つは、常に無料の Developer Edition 組織でした。誰もがこの組織を持っています。標準の Enterprise Edition 組織では追加のライセンス料金が必要となる機能の多くは、使用方法を習得するには十分な割り当てまたは制限で、ここでは無料で提供されますが、実際の運用での使用には実用的ではないほどの規模です。

Salesforce の大規模な生成 AI への転換が始まって以来、DE 組織は LLM、RAG、エージェントから切り離された不毛の荒野となっていました。しかし、もうそうではありません。

TDX の初日と同時に、新しい Developer Edition 組織が Agentforce を有効にして提供されるようになりました。Salesforce は、Agentforce が有効になっている DE 組織の LLM 出力を 1 時間あたり 150 に制限します。また、1 つのデータ スペースの容量も 10 GB に制限されます。Atlas エンジンへの 1 回の呼び出しで複数の LLM にアクセスできる場合、これが 1 回の 150 エージェント出力を意味するのか、それとも Agentforce への 1 回の呼び出しでその割り当てのいくつかが消費されるのかは現時点では不明です。ただし、実験と学習の目的では、ほとんどのニーズを満たすには十分であると思われます。

Zip in Apex

開発者は長い間、圧縮されたファイルを圧縮および解凍する機能を求めてきました。このリリースでは、ようやくこの機能が一般公開されます。Compression名前空間 (ドキュメントを参照)を使用して、ファイルを圧縮および解凍できます。Apex にはヒープ サイズ制限があるため、コードをテストして、操作できるファイルの最大サイズを確認してください。ヒープは、ファイルを圧縮するために使用される圧縮方法によって異なります。以下は、特定のライブラリのドキュメントを含む zip ファイルを作成し、同じライブラリに保存する方法を示す簡単な例です。

  • Compression.ZipWriter
/**
 * This class demonstrates how to use the Compression.ZipWriter to create a zip file
 * containing documents from a specific library and save it back to the same library.
 */
public with sharing class CompressionExample {
    /**
     * Archives documents from the specified library into a zip file and saves it back to the library.
     */
    public static void zip() {
        // Create an instance of Compression.ZipWriter to handle zip file creation
        Compression.ZipWriter zipWriter = new Compression.ZipWriter();

        // List to store ContentDocumentIds of documents to be compressed
        List contentDocumentIds = new List();

        // Get the ID of the ContentWorkspace (library) named 'Salesforce Characters'
        Id libraryId = [
            SELECT Id
            FROM ContentWorkspace
            WHERE Name = 'Salesforce Characters Zip'
            WITH USER_MODE
        ][0]
        .Id;

        // Iterate through ContentVersion records in the specified library and add them to the zip writer
        for (ContentVersion contentVersion : [
            SELECT PathOnClient, Versiondata
            FROM ContentVersion
            WHERE ContentDocument.ParentId = :libraryId
            WITH USER_MODE
        ]) {
            zipWriter.addEntry(
                contentVersion.PathOnClient,
                contentVersion.Versiondata
            );
        }

        // Get the resulting zip file as a blob
        Blob zippedFile = zipWriter.getArchive();

        // Save the zip file as a ContentVersion in the same library
        ContentVersion newContentVersion = new ContentVersion();
        newContentVersion.VersionData = zippedFile;
        newContentVersion.Title = 'Salesforce Characters';
        newContentVersion.PathOnClient = 'salesforce_characters.zip';
        insert as user newContentVersion;

        // Retrieve the ContentDocumentId associated with the saved ContentVersion
        newContentVersion = [
            SELECT Id, ContentDocumentId
            FROM ContentVersion
            WHERE Id = :newContentVersion.Id
            WITH USER_MODE
            LIMIT 1
        ];

        // Share the zip file to the library using ContentDocumentLink
        ContentDocumentLink contentDocumentLink = new ContentDocumentLink();
        contentDocumentLink.ContentDocumentId = newContentVersion.ContentDocumentId;
        contentDocumentLink.ShareType = 'I'; // Inferred permission
        contentDocumentLink.Visibility = 'AllUsers'; // Shared with all users
        contentDocumentLink.LinkedEntityId = libraryId;
        insert as user contentDocumentLink;
    }
 }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?