Replies: 1 comment
-
|
Hello,
This is how I fixed it: and then in infer: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
first of all, thanks a lot for your great work and for providing this library. I am fascinated by its few-shot capabilities.
Now to my question: I am using a custom provider like this for using AzureOpenAI models:
This works. However, I am using a special output_format which looks like this:
class BPMNAnnotation(BaseModel):
extraction_class: str = Field(..., description="Entity/type label")
extraction_text: str = Field(..., description="Exact text from source")
attributes: Optional[Dict[str, Union[str, int, float, bool, None]]] = Field(
None, description="Key-value attributes"
)
class BPMNExtractions(BaseModel):
extractions: List[BPMNAnnotation]
I am calling it like this:
result = lx.extract(
text_or_documents=process_summary,
prompt_description=instructions,
examples=examples,
model_id="azure-openai",
batch_length=1,
max_workers=1,
max_char_buffer=100000,
prompt_validation_level=pv.PromptValidationLevel.OFF,
fence_output=False,
language_model_params={
"api_version": self.llm_config.AZURE_OPENAI_API_VERSION,
"temperature": self.llm_config.AZURE_OPENAI_TEMPERATURE,
"top_p": self.llm_config.AZURE_OPENAI_TOP_P,
"deployment_name": self.llm_config.AZURE_OPENAI_DEPLOYMENT_NAME,
"max_tokens": self.llm_config.AZURE_OPENAI_MAX_TOKENS,
"response_format": self.output_model,
},
)
My problem is that the resolver tries to align everything and not just the value of extraction_text. How can i specify what field the resolver should align or not align? Your help would be much appreciated. Thanks a lot in advance.
Beta Was this translation helpful? Give feedback.
All reactions