# Import classes from the bigdata-client Python SDK        
from bigdata_client import Bigdata
from bigdata_client.models.chat import MarkdownLinkFormatter
from bigdata_client.models.chat import ChatScope

# Log in to Bigdata
bigdata = Bigdata("YOUR_USERNAME", "YOUR_PASSWORD")

# Create a new chat with a format for the inline attribution in reponses
formatter = MarkdownLinkFormatter()
chat = bigdata.chat.new("Pfizer company analysis", formatter)

# First question
response = chat.ask("Evaluate the experience and reputation of the management team of Pfizer in 2024", streaming=True, scope=ChatScope.NEWS)

print(f"\nQuestion:\n - {response.question}")
print(f"\nAnswer:")
for streamingChatInteraction in response:
  print(streamingChatInteraction, end="")

# Follow up question
response = chat.ask("Has it hired any senior AI expert?", streaming=True, scope=ChatScope.NEWS)

print(f"\nQuestion:\n - {response.question}")
print(f"\nAnswer:")
for streamingChatInteraction in response:
  print(streamingChatInteraction, end="")

# Delete chat
bigdata.chat.delete(chat.id)

It provides methods to interact with Chat objects, and is accesible from a Bigdata instance

Methods

new(name, formatter=None)

Create a new chat.

Parameters:

name
string
required

Chat’s name.

formatter
InlineAttributionFormatter | None

Format of the response inline attributions: InlineAttributionFormatter

Return type:

Chat

list(formatter=None)

Return a list with all chats

Parameters:

formatter
InlineAttributionFormatter | None

Format of the response inline attributions: InlineAttributionFormatter

Return type:

list[Chat]

get(id_, formatter=None)

Return a chat by its identifier.

Parameters:

id_
string
required

Unique chat identifier.

formatter
InlineAttributionFormatter | None

Format of the response inline attributions: InlineAttributionFormatter.

Return type:

Chat

delete(id_)

Delete a chat by its identifier

Parameters:

id_
string
required

Unique chat identifier

# Import classes from the bigdata-client Python SDK        
from bigdata_client import Bigdata
from bigdata_client.models.chat import MarkdownLinkFormatter
from bigdata_client.models.chat import ChatScope

# Log in to Bigdata
bigdata = Bigdata("YOUR_USERNAME", "YOUR_PASSWORD")

# Create a new chat with a format for the inline attribution in reponses
formatter = MarkdownLinkFormatter()
chat = bigdata.chat.new("Pfizer company analysis", formatter)

# First question
response = chat.ask("Evaluate the experience and reputation of the management team of Pfizer in 2024", streaming=True, scope=ChatScope.NEWS)

print(f"\nQuestion:\n - {response.question}")
print(f"\nAnswer:")
for streamingChatInteraction in response:
  print(streamingChatInteraction, end="")

# Follow up question
response = chat.ask("Has it hired any senior AI expert?", streaming=True, scope=ChatScope.NEWS)

print(f"\nQuestion:\n - {response.question}")
print(f"\nAnswer:")
for streamingChatInteraction in response:
  print(streamingChatInteraction, end="")

# Delete chat
bigdata.chat.delete(chat.id)