Skip to content

ChatKit usecase without frontend #643

@macro161

Description

@macro161

I want to call ChatKit directly from my Java code. I successfully generated a secret, but I don't understand what I should do next?

public void callOpenAI() {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .fromEnv()
                .apiKey("key")
                .build();

        var param2 = ChatSessionWorkflowParam.builder().id("id").build();
        var params = SessionCreateParams.builder().user("name").workflow( param2).build();

        ChatSession chatSession = client.beta().chatkit().sessions().create(params);

        String secret = chatSession.clientSecret();
    }

I want to call ChatKit with an initial text to begin the agent workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requestedsdk

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions