From 2e6c62eb9edb578ba3090d7692fcc4817b4abb42 Mon Sep 17 00:00:00 2001 From: Kathy Tran Date: Thu, 26 Sep 2024 13:38:14 -0400 Subject: [PATCH] Modify readme --- topicgenerator/README.md | 34 +++++++++++++++---- .../templates/topic-generator.config | 5 +-- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/topicgenerator/README.md b/topicgenerator/README.md index 06fa0997..21124868 100644 --- a/topicgenerator/README.md +++ b/topicgenerator/README.md @@ -1,6 +1,6 @@ # Topic Generator -This is a Java program that generates topics for public Dockstore entries using OpenAI's gpt-3.5-turbo-16k AI model. +This is a Java program that generates topics for public Dockstore entries using AI. The [entries.csv](entries.csv) file contains the TRS ID and default versions of public Dockstore entries to generate topics for. The [results](results) directory contains the generated topics for those entries from running the topic generator. @@ -8,15 +8,12 @@ The [entries.csv](entries.csv) file contains the TRS ID and default versions of ### Configuration file -Create a configuration file like the following. A template `metrics-aggregator.config` file can be found [here](templates/topic-generator.config). +Create a configuration file like the following. A template `topic-generator.config` file can be found [here](templates/topic-generator.config). ``` [dockstore] server-url: token: - -[ai] -openai-api-key: ``` **Required:** @@ -26,7 +23,26 @@ openai-api-key: - `https://staging.dockstore.org/api` - `https://dockstore.org/api` - `token`: The Dockstore token of an admin or curator. This token is used to upload topics to the webservice. -- `openai-api-key`: The OpenAI API key required for using the OpenAI APIs. See https://platform.openai.com/docs/api-reference/authentication for more details. This is used to generate topics. + +### Authentication to invoke AI models + +#### AWS Bedrock + +By default, the program uses AWS Bedrock to invoke the Anthropic Claude 3 Haiku model to generate topics. +AWS credentials that have permissions to use the AWS Bedrock API are required and they must have access to the Anthropic Claude models on AWS. +There are several ways that this can be provided. +Read [this](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html#credentials-chain) for the default credential provider chain. + + +#### OpenAI (deprecated) + +We have moved away from using OpenAI models to generate topics, but if you wish to use it, you need to add the following section to your configuration file. +See https://platform.openai.com/docs/api-reference/authentication for more details. + +``` +[ai] +openai-api-key: +``` ## Running the program @@ -49,6 +65,10 @@ Usage:
[options] [command] [command options] name of the entries to generate topics for. The first line of the file should contain the CSV fields: trsID,version Default: ./entries.csv + -m, --model + The AI model to use + Default: CLAUDE_3_HAIKU + Possible Values: [CLAUDE_3_5_SONNET, CLAUDE_3_HAIKU, GPT_4O_MINI] upload-topics Upload AI topics, generated by the generate-topics command, for public Dockstore entries. @@ -59,7 +79,7 @@ Usage:
[options] [command] [command options] of the entries to upload topics for. The first line of the file should contain the CSV fields: trsId,aiTopic. The output file generated by the generate-topics command can be used as the - argument. + argument. ``` ### generate-topics diff --git a/topicgenerator/templates/topic-generator.config b/topicgenerator/templates/topic-generator.config index 3a87d52b..2f34fb2d 100644 --- a/topicgenerator/templates/topic-generator.config +++ b/topicgenerator/templates/topic-generator.config @@ -1,7 +1,4 @@ # This is a template topic generator config file for prod. Modify it for different environments. [dockstore] server-url: https://dockstore.org/api -token: YOUR_ADMIN_OR_CURATOR_DOCKSTORE_TOKEN - -[ai] -openai-api-key: YOUR_OPENAI_API_KEY \ No newline at end of file +token: YOUR_ADMIN_OR_CURATOR_DOCKSTORE_TOKEN \ No newline at end of file