Claude AI
O NicoChat agora permite que seus usuários se conectem nativamente à plataforma Claude AI e usem os recursos dessa tecnologia de IA de ponta dentro dos seus chatbots.
Obtendo a chave da API do Claude
Para obter a chave da API, faça login em https://console.anthropic.com.
Depois de entrar, clique em Configurações no menu superior.

Em seguida, clique na guia de chaves no menu à esquerda e crie uma chave da API.

Integração com NicoChat
No painel da sua workspace do NicoChat, clique em Integrações e depois em Claude AI, na guia Inteligência Artificial.

Informe a chave da API que você obteve na sua conta do Claude e clique em Salvar. Você deve ver um sinal de verificação indicando que a integração foi concluída.

Usando o Claude no Editor do Fluxo
Você pode usar o Claude no Editor do Fluxo por meio do nó de ação. Crie um nó de ação e selecione a opção Integrações. No menu que aparece, clique em Claude.

Ações do Claude AI
O NicoChat integra-se nativamente com os seguintes endpoints oferecidos por Claude/Anthropic:

Criar Resposta com IA (Chat Completion)

Esta ação é usada para gerar chat/texto a partir do contexto e das informações fornecidas.
Payload
"id": "msg_01KCVbXDh7WREQYJrakkYBuS",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Here is a basic recipe and instructions for making homemade cupcakes: Ingredients: - 1 3/4 cups all-purpose flour - 1 1/2 teaspoons baking powder - 1/4 teaspoon salt - 1/2 cup unsalted butter, at room temperature - 1 cup granulated sugar - 2 large eggs, at room temperature - 1 teaspoon vanilla extract - 1/2 cup milk, at room temperature Instructions: 1. Preheat the oven to 350°F (177°C). Line a 12-cup muffin tin with paper liners. 2. In a medium bowl, whisk together the flour, baking powder, and salt. Set aside. 3. In a large bowl, beat the butter and sugar together until light and flu"
}
],
"model": "claude-3-haiku-20240307",
"stop_reason": "max_tokens",
"stop_sequence": null,
"usage": {
"input_tokens": 20,
"output_tokens": 200
},
"messages": [
{
"role": "user",
"content": "How can I make cupcakes"
},
{
"role": "assistant",
"content": "Here is a basic recipe and instructions for making homemade cupcakes: Ingredients: - 1 3/4 cups all-purpose flour - 1 1/2 teaspoons baking powder - 1/4 teaspoon salt - 1/2 cup unsalted butter, at room temperature - 1 cup granulated sugar - 2 large eggs, at room temperature - 1 teaspoon vanilla extract - 1/2 cup milk, at room temperature Instructions: 1. Preheat the oven to 350°F (177°C). Line a 12-cup muffin tin with paper liners. 2. In a medium bowl, whisk together the flour, baking powder, and salt. Set aside. 3. In a large bowl, beat the butter and sugar together until light and flu"
}
]
}
"id": "msg_01KCVbXDh7WREQYJrakkYBuS",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Here is a basic recipe and instructions for making homemade cupcakes: Ingredients: - 1 3/4 cups all-purpose flour - 1 1/2 teaspoons baking powder - 1/4 teaspoon salt - 1/2 cup unsalted butter, at room temperature - 1 cup granulated sugar - 2 large eggs, at room temperature - 1 teaspoon vanilla extract - 1/2 cup milk, at room temperature Instructions: 1. Preheat the oven to 350°F (177°C). Line a 12-cup muffin tin with paper liners. 2. In a medium bowl, whisk together the flour, baking powder, and salt. Set aside. 3. In a large bowl, beat the butter and sugar together until light and flu"
}
],
"model": "claude-3-haiku-20240307",
"stop_reason": "max_tokens",
"stop_sequence": null,
"usage": {
"input_tokens": 20,
"output_tokens": 200
},
"messages": [
{
"role": "user",
"content": "How can I make cupcakes"
},
{
"role": "assistant",
"content": "Here is a basic recipe and instructions for making homemade cupcakes: Ingredients: - 1 3/4 cups all-purpose flour - 1 1/2 teaspoons baking powder - 1/4 teaspoon salt - 1/2 cup unsalted butter, at room temperature - 1 cup granulated sugar - 2 large eggs, at room temperature - 1 teaspoon vanilla extract - 1/2 cup milk, at room temperature Instructions: 1. Preheat the oven to 350°F (177°C). Line a 12-cup muffin tin with paper liners. 2. In a medium bowl, whisk together the flour, baking powder, and salt. Set aside. 3. In a large bowl, beat the butter and sugar together until light and flu"
}
]
}
Nota: O campo do sistema “OpenAI” é usado para controlar o histórico de chat das ações do Claude, bem como das ações do OpenAI.
Limpar Memória da IA (Chat Completion)

Esta ação é usada para limpar o campo JSON do sistema “OpenAI”. O objetivo é manter o histórico sob controle e monitorar o tempo de execução das solicitações para evitar timeouts do servidor e consumo excessivo de tokens.
Lembre-se: mais informações para processar = mais consumo de tokens.
Visão - Imagem para Texto

Esta ação é usada para gerar texto a partir de uma imagem. O caso de uso é o usuário enviar uma imagem ao Claude, que a analisa com base no prompt e gera um resultado.
Payload
"id": "msg_01RFaDsXtJ9DCkMxkebTBBSs",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "The image shows a close-up view of a sunflower against a bright blue sky background. The sunflower has vibrant yellow petals radiating outwards from a large central disk floret. The disk floret appears greenish-yellow and has a subtle texture. The sunflower stem and leaves are visible at the bottom of the frame, adding some green contrast to the predominantly yellow flower. The petals look fresh and the flower seems to be in full bloom, capturing the iconic and cheerful appearance of a sunflower."
}
],
"model": "claude-3-opus-20240229",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 159,
"output_tokens": 114
}
}
"id": "msg_01RFaDsXtJ9DCkMxkebTBBSs",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "The image shows a close-up view of a sunflower against a bright blue sky background. The sunflower has vibrant yellow petals radiating outwards from a large central disk floret. The disk floret appears greenish-yellow and has a subtle texture. The sunflower stem and leaves are visible at the bottom of the frame, adding some green contrast to the predominantly yellow flower. The petals look fresh and the flower seems to be in full bloom, capturing the iconic and cheerful appearance of a sunflower."
}
],
"model": "claude-3-opus-20240229",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 159,
"output_tokens": 114
}
}

