FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury
0.1.0
Prefix Reserved
See the version list below for details.
dotnet add package FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury --version 0.1.0
NuGet\Install-Package FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury -Version 0.1.0
<PackageReference Include="FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury" Version="0.1.0" />
paket add FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury --version 0.1.0
#r "nuget: FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury, 0.1.0"
// Install FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury as a Cake Addin #addin nuget:?package=FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury&version=0.1.0 // Install FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury as a Cake Tool #tool nuget:?package=FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury&version=0.1.0
Conversational API Powered by FactSet Mercury client library for .NET
OVERVIEW
The FactSet Conversational API allows clients to white-label core FactSet Mercury capabilities in a client’s chatbot experience.
Request data from FactSet using natural language queries. Start the response generation using the /query
endpoint, poll the status using /status
. Once the result is ready, retrieve it using /result
.
If your response contains a file ID, such as for an Excel chart or a FactSet ActiveGraph, retrieve it using the file ID at the /download/file
endpoint.
We also encourage you to provide feedback on your responses using the /feedback
endpoint!
Please note: "Natural language" in this documentation refers to modern conversational English. Support for other languages is currently unavailable.
Try the Conversational API and view Available Content
In the Using the Conversational API Online Assistant you can find instructions on how to start using the Conversational API, and the full list of content available.
Some of the prompts supported are:
- What is Tesla's enterprise value?
- Create a chart showing CME price relative to the S&P 500
- What were the highlights from Palantir's recent earnings call?
Adaptive Card Format
The Conversational API uses the Microsoft Adaptive Card format for response data surfaced from FactSet content sets. Value
property of parent FederationData contains a JSON serialized presentation of a Microsoft Adaptive Card. See Microsoft docs for Adaptive Card documentation, and the Adaptive Card schema explorer for schema details. Please note: "The adaptive card may contain actions, which represent functionality within the card itself. In order to execute these actions, a handler must be implemented in your Adaptive Card rendering process. See handling actions for an example implementation.
STACH Format
The Conversational API may use Factset's STACH V3 format to represent tabular data in JSON. Please refer to the STACH V3 documentation on column organized data for more information on how to process STACH-organized data. <details> <summary><u>STACH Example</u></summary>
{
\"version\": \"3.1\",
\"table\": {
\"primaryKeys\": [
\"Insider Holders\",
\"MV (M,$)\",
\"% O/S\"
],
\"totalNumRows\": 5
},
\"views\": [
{
\"name\": \"view\",
\"displayName\": \"who are the suppliers of nike\",
\"table\": {
\"columns\": [
\"Insider Holders\",
\"MV (M,$)\",
\"% O/S\"
],
\"headers\": {
\"Insider Holders\": \"Insider Holders\",
\"MV (M,$)\": \"MV (M,$)\",
\"% O/S\": \"% O/S\"
}
}
}
],
\"columns\": [
{
\"name\": \"Insider Holders\",
\"contextualType\": \"string\",
\"customMetadata\": {
\"relevancy\": {
\"contextualType\": \"int32\",
\"value\": 100
}
}
},
{
\"name\": \"MV (M,$)\",
\"contextualType\": \"real\",
\"customMetadata\": {
\"relevancy\": {
\"contextualType\": \"int32\",
\"value\": 67
}
}
},
{
\"name\": \"% O/S\",
\"contextualType\": \"real\",
\"customMetadata\": {
\"relevancy\": {
\"contextualType\": \"int32\",
\"value\": 34
}
}
}
],
\"rows\": [
{
\"Insider Holders\": \"Knight Philip Hampson\",
\"MV (M,$)\": 3156.8,
\"% O/S\": 1.531
},
{
\"Insider Holders\": \"Knight Travis A\",
\"MV (M,$)\": 601.6,
\"% O/S\": 0.496
},
{
\"Insider Holders\": \"Wellcome Trust Ltd. (Direct Investments)\",
\"MV (M,$)\": 225.5,
\"% O/S\": 0.105
},
{
\"Insider Holders\": \"Parker Mark G\",
\"MV (M,$)\": 100.1,
\"% O/S\": 0.056
},
{
\"Insider Holders\": \"Donahoe John J Ii\",
\"MV (M,$)\": 19.8,
\"% O/S\": 0.018
}
]
}
</details>
Citations
Responses from the Conversational API may contain citations
which provide references to the source of the data directly within the textual response. Phrases within the response text are mapped to a data item in the citations
object via a bracketed ID (e.g. [1]
). Citations may be used to provide additional context or to verify the source of the data; in some cases, a single phrase within the response may be supported by multiple data sources.
Please note: Links to the source data are provided as links to FactSet's Document Viewer (see Document Viewer OA page). The link will direct you to the entire document; you may need to search for the specific phrase within the document. We are currently working on providing direct links to the specific section or excerpt of the document.
<details>
<summary><u>Citation Example</u></summary>
{
\"type\": \"string\",
\"value\": \"FactSet has expressed optimism about the potential of generative AI (GenAI) to enhance their product offerings and drive efficiency[1].\"
\"citations\": {
\"[1]\": [
\"phraseId\": \"aba1d533-08b3-4d3e-8961-5d37bb2caff6\",
\"content\": \"At the same time, expectations are high around the effect generative AI will have on our industry.\",
\"speakerInfo\": {
\"companyId\": \"0016YD-E\",
\"companyName\": \"FactSet Research Systems, Inc.\",
\"speakerId\": \"0DPHLH-E\",
\"speakerName\": \"Philip Snow\",
\"speakerTitle\": \"Chief Executive Officer & Director\"
},
\"sourceURL\": \"https://my.apps.factset.com/viewer-fusion/?_doc_id=2948302-t&_doc_date=20231219&_doc_product=FCST&_doc_docfn=/home/docs/fcst/8/302/2948302-t.pdf&e=false\"
]
}
}
</details>
This .NET package is automatically generated by the OpenAPI Generator project:
- API version: 0.6.0
- SDK version: 0.1.0
- Build package: com.factset.sdk.codegen.FactSetCSharpNetCoreClientCodegen
For more information, please visit https://developer.factset.com/contact
Requirements
- .NET Standard >= 2.0
Installation
.NET CLI
dotnet add package FactSet.SDK.Utils
dotnet add package FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury -v 0.1.0
NuGet
nuget install FactSet.SDK.Utils
nuget install FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury -Version 0.1.0
Usage
- Generate authentication credentials.
- Setup .NET Standard 2.0 compatible environment.
- Install dependencies.
- Run the following:
[!IMPORTANT] The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.
Example Code
using System;
using System.Threading.Tasks;
using FactSet.SDK.Utils.Authentication;
using FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury.Api;
using FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury.Client;
using FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury.Model;
namespace Example
{
public static class DownloadFileExample
{
public static async Task Main()
{
var config = new FactSet.SDK.ConversationalAPIPoweredbyFactSetMercury.Client.Configuration();
// Examples for each supported authentication method are below,
// choose one that satisfies your use case.
/* (Preferred) OAuth 2.0: FactSetOAuth2 */
// See https://github.com/FactSet/enterprise-sdk#oauth-20
// for information on how to create the app-config.json file
//
// The confidential client instance should be reused in production environments.
// See https://github.com/FactSet/enterprise-sdk-utils-dotnet#authentication
// for more information on using the ConfidentialClient class
ConfidentialClient confidentialClient = await ConfidentialClient.CreateAsync("/path/to/app-config.json");
config.OAuth2Client = confidentialClient;
/* Basic authentication: FactSetApiKey */
// See https://github.com/FactSet/enterprise-sdk#api-key
// for information how to create an API key
// config.Username = "USERNAME-SERIAL";
// config.Password = "API-KEY";
var apiInstance = new DownloadApi(config);
var fileDownloadRequest = new FileDownloadRequest(); // FileDownloadRequest | ID refers to the file ID in the NextStep action returned from the `/result` endpoint
try
{
// Retrieve data file based on file ID.
System.IO.Stream result = apiInstance.DownloadFile(fileDownloadRequest);
Console.WriteLine(result.ToJson());
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling DownloadApi.DownloadFile: " + e.Message );
Console.WriteLine("Status Code: "+ e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
}
Using a Proxy
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
Documentation for API Endpoints
All URIs are relative to https://api.factset.com/conversational/v0
Class | Method | HTTP request | Description |
---|---|---|---|
DownloadApi | DownloadFile | POST /download/file | Retrieve data file based on file ID. |
FeedbackApi | SendFeedback | POST /feedback | Send feedback on the response to a query. |
MultipleQuestionChatApi | GetChatResult | POST /result | Retrieve the completed response for your query. |
MultipleQuestionChatApi | GetChatStatus | POST /status | Retrieve the status of a chat response process. |
MultipleQuestionChatApi | QueryChat | POST /query | Create a query request for a given natural language query. |
Documentation for Models
- Model.AdaptiveCard
- Model.AdaptiveCardBodyElement
- Model.AdaptiveCardData
- Model.ChatPollingRequest
- Model.ChatPollingRequestData
- Model.Download
- Model.Error
- Model.ErrorObject
- Model.FederationData
- Model.FeedbackRequest
- Model.FeedbackRequestData
- Model.FileDownloadRequest
- Model.FileDownloadRequestData
- Model.NextStep
- Model.NextStepItem
- Model.OpenUrl
- Model.OpenUrlUrl
- Model.Phrase
- Model.PromptItem
- Model.PromptParameter
- Model.PromptParameters
- Model.QueryChatRequest
- Model.QueryChatRequestData
- Model.QueryChatResponse
- Model.QueryChatResponseData
- Model.QueryResponse
- Model.QueryResponseData
- Model.RateLimitExceededError
- Model.ResponseString
- Model.SpeakerInfo
- Model.StatusPollResponse
- Model.StatusPollResponseData
- Model.SuggestedPrompts
- Model.Table
- Model.TableData
Documentation for Authorization
FactSetApiKey
- Type: HTTP basic authentication
FactSetOAuth2
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes: N/A
Contributing
Please refer to the contributing guide.
Copyright
Copyright 2022 FactSet Research Systems Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FactSet.SDK.Utils (>= 1.0.0)
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 7.2.2)
- RestSharp (>= 106.15.0)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Refer to Changelog on GitHub source repository