diff --git a/src/tools/api_tool.ts b/src/tools/api_tool.ts index b961d8d..fd93edf 100644 --- a/src/tools/api_tool.ts +++ b/src/tools/api_tool.ts @@ -1,12 +1,14 @@ export interface Tool { name: string; description: string; + twitterAccount: string; execute(input: string): Promise; } export abstract class APITool implements Tool { name: string; description: string; + twitterAccount: string = ''; protected apiKey: string; constructor(name: string, description: string, apiKey: string) { diff --git a/src/tools/tool.ts b/src/tools/tool.ts index 02bb2d3..3e1bbc0 100644 --- a/src/tools/tool.ts +++ b/src/tools/tool.ts @@ -1,5 +1,6 @@ export interface Tool { name: string; description: string; + twitterAccount: string; execute(input: string): Promise; } \ No newline at end of file diff --git a/src/tools/weatherapi.ts b/src/tools/weatherapi.ts index 62bfe84..eeebdf0 100644 --- a/src/tools/weatherapi.ts +++ b/src/tools/weatherapi.ts @@ -20,6 +20,8 @@ interface NubilaWeatherResponse { export class WeatherTool implements Tool { name: string = "WeatherAPI"; description: string = "Gets the current weather from Nubila API. Input is json with latitude and longitude to retrieve weather data."; + twitterAccount: string = "nubilanetwork"; + private readonly apiKey: string; private readonly baseUrl: string; diff --git a/src/workflow.ts b/src/workflow.ts index fbee79c..d47f465 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -55,7 +55,7 @@ export class Workflow { Tool Input: ${action.output} Tool Output: ${toolOutput} - Generate a human-readable response based on the tool output. + Generate a human-readable response based on the tool output${action.tool.twitterAccount.length > 0 ? ` and mention the source of data by tagging the twitter account ${action.tool.twitterAccount} in the response` : ''}. `; output = await this.llm.generate(finalPrompt);