Comments (14)
@tanya-rai @Ankush-lastmile!
I would like to pick this up. Can I have some more context for the issue?
from aiconfig.
Hi @sp6370! Apologies for the delay in getting back to you.
Starting with the python sdk, you can find the current method definition of add_output
method in schema.py
As you can see, this method currently accepts a single output. The goal is to extend its functionality to handle multiple outputs. A possible approach is to introduce a new method, add_outputs
, which would be similar in design to add_output. However, instead of a single output, it would accept a list of outputs. This method would then iterate over the list, utilizing the existing add_output
method for each individual item.
I also notice a typo in the docstring, feel free to fix that up as well!
Looking forward to your thoughts and contributions on this! Please feel free to reach out if you have any questions or need further clarification.
from aiconfig.
@Ankush-lastmile Any context on this?
from aiconfig.
Hey @sp6370, thanks for following up on this! I apologize for the delay. I've been tied up with a few other tasks. I'll make sure to provide you with the necessary context by the eod so you can start working on the issue. Thanks for your patience!
from aiconfig.
Gotchya! Could you go ahead and create a issue for this and assign to me?
For the this issue, I will implement error handling as discussed above and raise the PR later today.
from aiconfig.
Could you go ahead and create a issue for this and assign to me?
Great! Created #529
I'm unable to assign your user to the issue for some reason at the moment, I'll try again later today. Looking forward to see your incoming pr's
from aiconfig.
Amazing! Yeah you should be able to. @Ankush-lastmile will provide some context today so you can get started.
from aiconfig.
@Ankush-lastmile No worries! Please take your time.
from aiconfig.
@Ankush-lastmile Could you elaborate what does not output do here?
https://github.com/lastmile-ai/aiconfig/blob/main/python/src/aiconfig/schema.py#L533
As per my understanding not output
=> User hasn't given anything to add to the prompt output. In that case, the function should just exit.
If it's empty then, why are we adding it to prompt.outputs
?
Is there something that I am missing here?
from aiconfig.
Great observation, @sp6370! Your understanding seems correct – if 'output' is non-existent, it ideally shouldn't proceed to add anything to 'prompt.outputs'. Exiting the function or raising an error in this scenario would be a more appropriate action.
This does look like a potential oversight in our current implementation. Your eye for this detail is much appreciated! We should consider addressing this as part of the enhancement.
I Would recommend that we throw an exception here if Output is None, considering the fact that the Output object being passed in is not optional.
from aiconfig.
@Ankush-lastmile I have sent you a message over Discord. Could you have a look at my request?
from aiconfig.
I can't seem to get the add_output
working.
import os
from aiconfig import AIConfigRuntime
import aiconfig_extension_gemini
from aiconfig.schema import ExecuteResult
os.environ['GOOGLE_API_KEY'] = ""
config = AIConfigRuntime(**{
"name": "Exploring Gemini",
"description": "",
"schema_version": "latest",
"metadata": {
"models": {
"gemini-pro": {
"stream": True
}
},
"default_model": "gemini-pro",
"model_parsers": {}
},
"prompts": [
{
"name": "multilinguality",
"input": "Can you teach me how to say duck in Mexican?",
"metadata": {
"model": "gemini-pro",
"remember_chat_context": False
}
},
{
"name": "pronounciation",
"input": "Can you explain how to pronounce the {{language}} one?",
"metadata": {
"model": "gemini-pro",
"remember_chat_context": False
}
}
]
})
config.save("gemini_demo.aiconfig.json")
from aiconfig import CallbackManager, InferenceOptions
aiconfig = AIConfigRuntime.load("gemini_demo.aiconfig.json")
test_result = ExecuteResult(
output_type="execute_result",
execution_count=0.0,
data={"role": "assistant", "content": "test output"},
metadata={"finish_reason": "stop"},
)
aiconfig.add_output("multilinguality", test_result)
#aiconfig.delete_output("multilinguality")
await aiconfig.run("multilinguality")
output_text = aiconfig.get_output_text("multilinguality")
print(f'Gemini output: {output_text} \n')
Expected Output:
Gemini output: Pato test output
Can you let me know what I am missing here?
from aiconfig.
@Ankush-lastmile Any thoughts on How should I go about resolving this?
from aiconfig.
Any thoughts on How should I go about resolving this?
I noticed your approach with the run() method in the code. run()
clears any previous outputs each time it's executed.
One thing you could try is adjusting the sequence of your operations. I would reccomend trying to either add the output after executing run or see if you can achieve your goal without using run at all initially.
Here's some pseudocode to illustrate:
output = ExecuteResult(...)
aiconfig.add_output("multilinguality", output)
print(aiconfig.get_prompt("multilinguality")) # print prompt. Should have new output added
This might help in better understanding how your changes are affecting the output. Give it a shot and let me know your findings!
from aiconfig.
Related Issues (20)
- Remove hf.py from core model parser HOT 2
- New lines aren't respected in YAML
- Editing aiconfig file while vs code extension is open
- Support LateX rendering for outputs
- Pybars compiling throws error for streamlit app
- [editor] Add button to clear single prompt output HOT 1
- .env not loaded automatically HOT 2
- [editor] Ctrl+Z does not return the prompts - input however returns the outputs - data HOT 6
- Support Python 3.9 in the python SDK
- [UI] Spacing between Global Model Settings and Global Parameters components
- [investigate] Replace get_raw_prompt_from_config with `resolve_prompt()`
- [Backlog] Specify test parameters that don't get persisted into the config file
- [UI][editor] Make Autosave to make it clearer what it does
- [UI][editor] Make it clearer what expand panel button does
- [UI][editor] Make it clear what copy button in Output section does
- Ai sdk HOT 1
- https://github.com/lastmile-ai/aiconfig/pull/1498#issue-2333066487
- Hey HOT 1
- IHeyReally.com HOT 1
- [AIConfig 2.0] Chat History HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiconfig.