-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathlog.py
More file actions
27 lines (20 loc) · 762 Bytes
/
Copy pathlog.py
File metadata and controls
27 lines (20 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
This example is for the configuration of logs.
"""
import logging
import os
from cozepy import setup_logging
# open debug logging, default is warning
setup_logging(level=logging.DEBUG)
# Get an access_token through personal access token or oauth.
coze_api_token = os.getenv("COZE_API_TOKEN")
from cozepy import Coze, TokenAuth, BotPromptInfo, Message, ChatEventType, MessageContentType # noqa
# Init the Coze client through the access_token.
coze = Coze(auth=TokenAuth(token=coze_api_token or "mock"))
# Invoke the create interface to create a bot in the draft status.
bot = coze.bots.create(
# The bot should exist under a space and your workspace id needs configuration.
space_id="workspace id",
# Bot name
name="translator bot",
)