Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repo] fix: C# Citations' encodingFormat to not be hardcoded. Fix JS AssistantsPlanner options to set api version #2235

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ public class ClientCitationAppearance
public string Abstract { get; set; } = string.Empty;

/// <summary>
/// The encoding format used for the icon.
/// Optional. Encoding format of the `citation.appearance.text` field.
corinagum marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
[JsonProperty(PropertyName = "encodingFormat")]
public string EncodingFormat { get; set; } = "text/html";
public string? EncodingFormat { get; set; }

/// <summary>
/// The icon provided in the citation ui.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ describe('AssistantsPlanner', () => {

const options: AssistantsPlannerOptions = {
apiKey: 'test-key',
assistant_id: 'test-assistant-id'
assistant_id: 'test-assistant-id',
api_version: '2024-02-15'
};

planner = new AssistantsPlanner<TurnState>(options);
Expand Down
6 changes: 6 additions & 0 deletions js/packages/teams-ai/src/planners/AssistantsPlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export interface AssistantsPlannerOptions {
* Defaults to 'conversation.assistants_state'.
*/
assistants_state_variable?: string;

/**
* Optional. Version of the API being called. Default is '2024-02-15-preview'.
*/
api_version?: string;
}

/**
Expand All @@ -92,6 +97,7 @@ export class AssistantsPlanner<TState extends TurnState = TurnState> implements
this._options = {
polling_interval: DEFAULT_POLLING_INTERVAL,
assistants_state_variable: DEFAULT_ASSISTANTS_STATE_VARIABLE,
api_version: '2024-02-15-preview',
...options
};

Expand Down
2 changes: 1 addition & 1 deletion js/packages/teams-ai/src/types/ClientCitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface ClientCitation {
abstract: string;

/**
* Encoding format of the ` citation.appearance.text` field.
* Encoding format of the `citation.appearance.text` field.
*/
encodingFormat?: 'application/vnd.microsoft.card.adaptive';

Expand Down
3 changes: 2 additions & 1 deletion js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ if (!process.env.ASSISTANT_ID) {
const planner = new AssistantsPlanner({
apiKey: apiKey,
endpoint: endpoint,
assistant_id: process.env.ASSISTANT_ID!
assistant_id: process.env.ASSISTANT_ID!,
api_version: '2024-02-15-preview'
});

// Define storage and application
Expand Down
3 changes: 2 additions & 1 deletion js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ if (!process.env.ASSISTANT_ID) {
const planner = new AssistantsPlanner({
apiKey: apiKey,
endpoint: endpoint,
assistant_id: process.env.ASSISTANT_ID ?? assistantId
assistant_id: process.env.ASSISTANT_ID ?? assistantId,
api_version: '2024-02-15-preview'
});

// Define storage and application
Expand Down
4 changes: 2 additions & 2 deletions python/packages/ai/teams/ai/citations/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class Appearance(Model):
text (str): Optional; ignored in Teams
url (str): The url of the document
abstract (str): Content of the citation. Must be clipped if longer than 480 characters
encodingFormat (str): The encoding format of the citation
image (str): Used for icon; for not it is ignored
encodingFormat (str): Encoding format of the `citation.appearance.text` field.
corinagum marked this conversation as resolved.
Show resolved Hide resolved
image (str): Used for icon; for now it is ignored
keywords (list[str]): The optional keywords to the citation
usageInfo (SensitivityUsageInfo): The optional sensitivity content information
"""
Expand Down
Loading