Skip to content

Commit

Permalink
Update citations abstract length to be max 480 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina Gum committed Sep 30, 2024
1 parent 4c6abf7 commit e032303
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class ClientCitationAppearance
public string? Url { get; set; }

/// <summary>
/// Content of the citation. Should be clipped if longer than ~500 characters.
/// Content of the citation. Must be clipped if longer than 480 characters.
/// </summary>
[JsonProperty(PropertyName = "abstract")]
public string Abstract { get; set; } = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task<string> SayCommandAsync([ActionTurnContext] ITurnContext turnC
int i = 0;
foreach (Citation citation in command.Response.Context.Citations)
{
string abs = CitationUtils.Snippet(citation.Content, 500);
string abs = CitationUtils.Snippet(citation.Content, 480);
if (isTeamsChannel)
{
content.Replace("\n", "<br>");
Expand Down
4 changes: 2 additions & 2 deletions js/packages/teams-ai/src/actions/SayCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface ClientCitation {
url?: string;

/**
* Content of the citation. Should be clipped if longer than ~500 characters.
* Content of the citation. Must be clipped if longer than 480 characters.
*/
abstract: string;

Expand Down Expand Up @@ -179,7 +179,7 @@ export function sayCommand<TState extends TurnState = TurnState>(feedbackLoopEna
appearance: {
'@type': 'DigitalDocument',
name: citation.title || `Document #${i + 1}`,
abstract: Utilities.snippet(citation.content, 500)
abstract: Utilities.snippet(citation.content, 480)
}
};

Expand Down
2 changes: 1 addition & 1 deletion python/packages/ai/teams/ai/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ async def _on_say_command(
position=f"{i + 1}",
appearance=Appearance(
name=citation.title or f"Document {i + 1}",
abstract=snippet(citation.content, 500),
abstract=snippet(citation.content, 480),
),
)
)
Expand Down
2 changes: 1 addition & 1 deletion python/packages/ai/teams/ai/citations/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Appearance(Model):
name (str): The name of the document
text (str): Optional; ignored in Teams
url (str): The url of the document
abstract (str): Content of the citation. Should be clipped if longer than ~500 characters
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
keywords (list[str]): The optional keywords to the citation
Expand Down

0 comments on commit e032303

Please sign in to comment.