Skip to content

Commit a4404d5

Browse files
authored
Merge pull request #22 from openworm/development
To v0.2.5
2 parents 0cccc77 + 897c4e4 commit a4404d5

File tree

11 files changed

+4923
-31
lines changed

11 files changed

+4923
-31
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
deploy:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ venv/
1616
/openworm_ai/corpus/wormatlas/ignore
1717
/openworm_ai/quiz/samples/GPT4o_10questions_general.json
1818
/openworm_ai/quiz/samples/GPT4o_10questions_science.json
19+
/dist

corpus/papers/test/SinhaEtAl2025.pdf.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

openworm_ai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Version of the Python module.
2-
__version__ = "0.2.1"
2+
__version__ = "0.2.5"
33

44

55
def print_(msg, print_it=True):

openworm_ai/graphrag/GraphRAG_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ def process_query(query, model, verbose=False):
263263
"What can you tell me about Alan Coulson?",
264264
"The NeuroPAL transgene is amazing. Give me some examples of fluorophores in it.",
265265
]
266-
"""queries = [
267-
"What can you tell me about Alan Coulson?",
268-
]"""
266+
queries = [
267+
"What are the main differences between NeuroML versions 1 and 2?",
268+
]
269269

270270
print_("Processing %i queries" % len(queries))
271271

openworm_ai/parser/ParseLlamaIndexJson.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def convert_to_json(paper_ref, paper_info, output_dir):
7979
"corpus/papers/test/PrimerOnCElegans.pdf.json",
8080
"https://academic.oup.com/genetics/article/200/2/387/5936175",
8181
],
82+
"Sinha_et_al_2025": [
83+
"corpus/papers/test/SinhaEtAl2025.pdf.json",
84+
"https://elifesciences.org/articles/95135",
85+
],
8286
}
8387

8488
# Loop through papers and process markdown sections

openworm_ai/utils/llms.py

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66

77
LLM_CMD_LINE_ARGS = {}
88

9-
LLM_GPT35 = "GPT3.5"
10-
LLM_GPT4 = "GPT4"
11-
LLM_GPT4o = "GPT4o"
9+
LLM_GPT35 = "gpt-3.5-turbo-instruct"
10+
LLM_CMD_LINE_ARGS["-gpt35"] = LLM_GPT35
11+
LLM_GPT4 = "gpt-4"
12+
LLM_GPT4o = "gpt-4o"
1213

1314
LLM_LLAMA2 = "LLAMA2"
1415
LLM_CMD_LINE_ARGS["-l"] = LLM_LLAMA2
15-
LLM_GEMINI = "gemini-2.0-flash"
16-
LLM_CMD_LINE_ARGS["-g"] = LLM_GEMINI
17-
LLM_AI21 = "AI21"
18-
LLM_CMD_LINE_ARGS["-a"] = LLM_AI21
16+
LLM_GEMINI_2F = "gemini-2.0-flash"
17+
LLM_CMD_LINE_ARGS["-g"] = LLM_GEMINI_2F
1918
LLM_CLAUDE37 = "claude-3-7-sonnet-20250219"
2019
LLM_CMD_LINE_ARGS["-c"] = LLM_CLAUDE37
2120
LLM_COHERE = "Cohere"
@@ -57,12 +56,11 @@
5756
OPENAI_LLMS = [LLM_GPT35, LLM_GPT4, LLM_GPT4o]
5857

5958
PREF_ORDER_LLMS = (
60-
LLM_GEMINI,
59+
LLM_GEMINI_2F,
6160
LLM_LLAMA2,
6261
LLM_GPT35,
6362
LLM_GPT4,
6463
LLM_GPT4o,
65-
LLM_AI21,
6664
LLM_CLAUDE37,
6765
LLM_COHERE,
6866
LLM_OLLAMA_LLAMA32,
@@ -108,12 +106,6 @@ def get_gemini_api_key():
108106
return gemini_api_key
109107

110108

111-
def get_ai21_api_key():
112-
ai21_api_key = os.environ.get["AI21_API_KEY"]
113-
114-
return ai21_api_key
115-
116-
117109
def get_anthropic_key():
118110
anthropic_api_key = os.environ.get("CLAUDE_API_KEY")
119111

@@ -130,21 +122,27 @@ def get_llm(llm_ver, temperature):
130122
if llm_ver == LLM_GPT35:
131123
from langchain_openai import OpenAI
132124

133-
return OpenAI(temperature=temperature, openai_api_key=get_openai_api_key())
125+
llm = OpenAI(
126+
model_name=LLM_GPT35,
127+
temperature=temperature,
128+
openai_api_key=get_openai_api_key(),
129+
)
130+
# print(llm)
131+
return llm
134132

135133
elif llm_ver == LLM_GPT4:
136134
from langchain_openai import ChatOpenAI
137135

138136
return ChatOpenAI(
139-
model_name="gpt-4",
137+
model_name=LLM_GPT4,
140138
openai_api_key=get_openai_api_key(),
141139
temperature=temperature,
142140
)
143141
elif llm_ver == LLM_GPT4o:
144142
from langchain_openai import ChatOpenAI
145143

146144
return ChatOpenAI(
147-
model_name="gpt-4o",
145+
model_name=LLM_GPT4o,
148146
openai_api_key=get_openai_api_key(),
149147
temperature=temperature,
150148
)
@@ -165,20 +163,15 @@ def get_llm(llm_ver, temperature):
165163

166164
llm = ChatLlamaAPI(client=llama)
167165

168-
elif llm_ver == LLM_GEMINI:
166+
elif llm_ver == LLM_GEMINI_2F:
169167
from langchain_google_genai import ChatGoogleGenerativeAI
170168

171169
return ChatGoogleGenerativeAI(
172-
model="gemini-2.0-flash",
170+
model=LLM_GEMINI_2F,
173171
google_api_key=get_gemini_api_key(), # Retrieve API key
174172
temperature=temperature,
175173
)
176174

177-
elif llm_ver == LLM_AI21:
178-
from langchain_ai21 import AI21LLM
179-
180-
llm = AI21LLM(model="j2-ultra")
181-
182175
elif llm_ver == LLM_CLAUDE37:
183176
from langchain_anthropic import ChatAnthropic
184177

0 commit comments

Comments
 (0)